Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
tmp
bin/configlet
bin/configlet.exe
.idea/
2 changes: 1 addition & 1 deletion exercises/accumulate/accumulate.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def accumulate():
def accumulate(array, function):

@ilya-khadykin ilya-khadykin Aug 22, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks Ok to me, but some people would argue that you will force people to certain implementations by giving exact params.

I personally think it's a good idea to do so anyway, if one still doesn't want to follow suggested method signature he/she can ignore it and write his/her own implementation.

Moreover, sometimes forcing certain implementation helps people to use features of the language they aren't used to (like passing functions to a method, not all languages allow that etc)

As an improvement, I would name params with meaningful names rather than generic ones. But it's up to you to decide

@jankaifer jankaifer Aug 22, 2017 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an improvement, I would name params with meaningful names rather than generic ones. But it's up to you to decide

I wanted to use names from example.py, but as @behrtam said in issue #509 choosing good name is important thing too. So I chose generic ones. But that is just detail which depends on exercise creator.

And meaningful names are sometimes too long or it's not clear the type of variable just from the name.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jankaifer, got it, thanks for clarification

pass
10 changes: 9 additions & 1 deletion exercises/allergies/allergies.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
class Allergies(object):
def __init__(self):

def __init__(self, number):
pass

def is_allergic_to(self, string):
pass

@property
def lst(self):
pass
2 changes: 1 addition & 1 deletion exercises/alphametics/alphametics.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def solve():
def solve(string):
pass
2 changes: 1 addition & 1 deletion exercises/anagram/anagram.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def detect_anagrams():
def detect_anagrams(string, array):
pass
4 changes: 2 additions & 2 deletions exercises/atbash-cipher/atbash_cipher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def encode():
def encode(string):
pass


def decode():
def decode(string):
pass
4 changes: 2 additions & 2 deletions exercises/beer-song/beer_song.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def verse():
def verse(number):
pass


def song():
def song(number1, number2=0):
pass
2 changes: 1 addition & 1 deletion exercises/binary-search/binary_search.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def binary_search():
def binary_search(array, number):
pass
2 changes: 1 addition & 1 deletion exercises/binary/binary.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def parse_binary():
def parse_binary(string):
pass
2 changes: 1 addition & 1 deletion exercises/bob/bob.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def hey():
def hey(string):
pass
2 changes: 1 addition & 1 deletion exercises/book-store/book_store.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def calculate_total():
def calculate_total(array, number=None):
pass
2 changes: 1 addition & 1 deletion exercises/bracket-push/bracket_push.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def check_brackets():
def check_brackets(string):
pass