-
Notifications
You must be signed in to change notification settings - Fork 1
Introduce keyword-only arguments for functions #127
Copy link
Copy link
Open
Milestone
Description
#106 removes an argument we decided is sort of useless. This should be fine, but there's a (small) chance that someone there was relying on the order of arguments, and passing a value as positional argument.
To illustrate:
def plot_something(sequence, foo=True, bar=False, baz=False):
# ...
plot_something(seq, False, True)If the bar=False parameter gets removed, the final line would silently keep working, but the argument values would be passed differently.
We should discuss whether (and in which cases!) we should use keyword-only arguments. E.g., a function like the following would not allow to pass values to foo and bar by position:
def plot_something(sequence, *, foo=True, bar=False, baz=False):
# ...
plot_something(seq, False, True) # Results in an error, as there is only 1 positional argumentReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels