-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37579: Return NotImplemented in Python implementation of __eq__ to match C implementation of datetime for timedelta and time #14726
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
…types in Python implementation to match C implementation
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.
Code makes sense, test added.
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.
Thank you for doing this @tirkarthi. I have a few minor quibbles inline, but overall this is a very solid PR.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@pganssle Thank you for the review. I am convinced to use a dedicated test object instead of |
Thanks for making the requested changes! @pganssle: please review the changes made to this pull request. |
Thanks @tirkarthi for the PR and @serhiy-storchaka for the review and report. |
Thanks Paul. Is this worth backporting? this seems like a bug fix to me. |
This seems like a bug fix to me too. |
I'm fine with backporting it since it's a PEP 399 violation. |
Thanks @tirkarthi for the PR, and @pganssle for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @tirkarthi for the PR, and @pganssle for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @tirkarthi and @pganssle, I had trouble checking out the |
pythonGH-14726) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. bpo-37579 (cherry picked from commit e6b46aa) Co-authored-by: Xtreak <tir.karthi@gmail.com>
GH-14743 is a backport of this pull request to the 3.8 branch. |
…nd time (pythonGH-14726) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. bpo-37579 (cherry picked from commit e6b46aa) Co-authored-by: Xtreak <tir.karthi@gmail.com>
GH-14745 is a backport of this pull request to the 3.7 branch. |
GH-14726) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. bpo-37579 (cherry picked from commit e6b46aa) Co-authored-by: Xtreak <tir.karthi@gmail.com>
…nd time (GH-14726) (GH-14745) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. [bpo-37579](https://bugs.python.org/issue37579) (cherry picked from commit e6b46aa) Co-authored-by: Xtreak <tir.karthi@gmail.com> https://bugs.python.org/issue37579
pythonGH-14726) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. bpo-37579
pythonGH-14726) Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation. This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation. bpo-37579
When the other object being compared is not the same type then :exc:
NotImplemented
is returned in C implementation ofdatetime.timedelta
anddatetime.time
. Change the Python implementation to match the C implementationhttps://bugs.python.org/issue37579