-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Keyword only argument default values are evaluated before other defaults #61171
Comments
Suprisingly, keyword only arguments become evaluated first: >>> def f(a=undefined1,*,b=undefined2):pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'undefined2' is not defined It should be "undefined1". I am sure, this is going to surprise developers and breaks assumptions, people tend to make. So far (to my knowledge) nothing that was separated by a "," could be evaluated in a mixed order. Please consider to change this around. |
Looks like a bug to me, although it isn't likely to cause great harm. |
Agreed on it being a bug that we do it the wrong way around, but "Yikes!" at the idea of code where it makes a significant difference. |
New changeset d296cf1600a8 by Benjamin Peterson in branch 'default': |
New changeset 6917402c6191 by Benjamin Peterson in branch 'default': |
I can confirm that Python3.4 is not affected. Python 3.3 and 3.2 still are. |
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: