-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-126947: Typechecking for _pydatetime.timedelta.__new__ arguments #126949
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
bombs-kim
commented
Nov 18, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Add typecheck in _pydatetime.timedelta so that same format error is raised as in _datetime.timedelta
- Add relevant tests for the new typecheck in datetime module
- Issue: Typecheck can be added to _pydatetime.timedelta.__new__ #126947
…aised as in _datetime.timedelta
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.
Now python implementation is in line with C implementation. Please, add a NEWS entry.
@sobolevn a NEWS entry has been added |
Misc/NEWS.d/next/Library/2024-11-18-19-03-46.gh-issue-126947.NiDYUe.rst
Outdated
Show resolved
Hide resolved
…iDYUe.rst Co-authored-by: sobolevn <[email protected]>
Misc/NEWS.d/next/Library/2024-11-18-19-03-46.gh-issue-126947.NiDYUe.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Bierma <[email protected]>
Thanks! Let's wait for code-owners to review :) |
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.
LGTM. The PR doesn't change the exception type, but provides a better error message.
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.
I might as well hop on the approval train :)
How do we feel about backporting?
It's a bad idea to change error messages in a stable release, it can break tests. |
Thanks everyone! |
…ents (python#126949) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Peter Bierma <[email protected]>