-
-
Notifications
You must be signed in to change notification settings - Fork 30k
-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
inconsistency with bare * in parameter list #46865
Comments
A bare * in a parameter list behaves differently depending on what Py30a4:
>>> def g(*, **kwargs): return 1
SyntaxError: named arguments must follow bare * (<pyshell#10>, line 1) I don't know if this is a bug or not but thought it worth querying. This |
It seems like f(a=1, b=2) and g(a=1, b=2) should be equivalent. Anyone |
Guido, what do you say? |
Agreed with Buck and Mark, this looks like a bug. Or, rather, a |
I see it differently. The rule is simply that if you use a bare * you def g(*, **kwds): ... and def g(**kwds): ... |
If there's no difference then they should work the same? |
Rationale for banning f(*,**k): it could represent a bug (intended bare |
/agree |
Here is example where it's necessary, but still raising an error:
>>> def my_method(self, *, **kwargs):
... pass
...
File "<stdin>", line 1
SyntaxError: named arguments must follow bare * |
I promise you it's not necessary in that example. Leaving out the '*' has the same effect as what you intend there. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: