-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Correct positional-only parameters in datetime.pyi
#6343
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
Conversation
These are all positional-or-keyword parameters in the pure-Python implementation, but positional-only parameters in the C implementation. Thus, passing them as keyword arguments is unreliable, and will result in errors being raised in some situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It's probably worth submitting a PR to CPython to get the Python implementation synced.
I created https://bugs.python.org/issue45821, but stopped short of filing a PR, as I wasn't sure if making all the parameters positional-only in the Python implementation would be backwards-compatible -- it might be better to make all the parameters in the C implementation positional-or-keyword? And, uh, I can't write C code (yet) 😢 |
This comment has been minimized.
This comment has been minimized.
Oh, that diff is entirely due to the second argument of |
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
These are all positional-or-keyword parameters in the pure-Python implementation, but positional-only parameters in the C implementation. Thus, passing them as keyword arguments is unreliable, and will result in errors being raised in some situations.