Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use keyword-only arguments #303

Open
fepegar opened this issue Sep 17, 2020 · 1 comment
Open

Use keyword-only arguments #303

fepegar opened this issue Sep 17, 2020 · 1 comment
Labels
dev enhancement New feature or request

Comments

@fepegar
Copy link
Owner

fepegar commented Sep 17, 2020

As suggested by @dvolgyes in #277.

More info in PEP 3102.

@fepegar fepegar added the enhancement New feature or request label Sep 17, 2020
@dvolgyes
Copy link
Contributor

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. :)

@fepegar fepegar added the dev label Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants