torchio icon indicating copy to clipboard operation
torchio copied to clipboard

Use keyword-only arguments

Open fepegar opened this issue 4 years ago • 1 comments

As suggested by @dvolgyes in #277.

More info in PEP 3102.

fepegar avatar Sep 17 '20 17:09 fepegar

For the sake of completeness, PEP-570 about positional-only arguments should also be kept in mind. https://www.python.org/dev/peps/pep-0570/

def name(positional_only_parameters, /, positional_or_keyword_parameters, *, keyword_only_parameters):

I prefer the keywords-only signatures for public API, however, it is slightly inconvenient (too much typing). Positional only arguments could be considered for very stable part of an API. I do not actually recommend it, but when there is a decision about function signatures, then it is a good time to consider all options. :)

dvolgyes avatar Sep 17 '20 19:09 dvolgyes