-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-43475: Fix the Python implementation of hash of Decimal NaN #26679
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
self.assertEqual(hashit(value), hashit(int(value))) | ||
|
||
#the same hash that to an int | ||
self.assertEqual(hashit(Decimal(23)), hashit(23)) |
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.
Covered by tests above.
self.assertTrue(hashit(Decimal('Inf'))) | ||
self.assertTrue(hashit(Decimal('-Inf'))) |
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.
Covered by tests below.
|
||
#the same hash that to an int | ||
self.assertEqual(hashit(Decimal(23)), hashit(23)) | ||
self.assertRaises(TypeError, hash, Decimal('sNaN')) |
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.
Moved to test_hash_method_nan
.
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
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-26706 is a backport of this pull request to the 3.10 branch. |
…onGH-26679) (cherry picked from commit 9f1c5f6) Co-authored-by: Serhiy Storchaka <[email protected]>
…6679) (cherry picked from commit 9f1c5f6) Co-authored-by: Serhiy Storchaka <[email protected]>
https://bugs.python.org/issue43475