bpo-43475: Fix the Python implementation of hash of Decimal NaN by serhiy-storchaka · Pull Request #26679 · python/cpython
| self.assertEqual(hashit(value), hashit(int(value))) | ||
|
|
||
| #the same hash that to an int | ||
| self.assertEqual(hashit(Decimal(23)), hashit(23)) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Covered by tests above.
Comment on lines -1822 to -1823
| self.assertTrue(hashit(Decimal('Inf'))) | ||
| self.assertTrue(hashit(Decimal('-Inf'))) |
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')) |
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.
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.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
…onGH-26679) (cherry picked from commit 9f1c5f6) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this pull request