bpo-43475: Fix the Python implementation of hash of Decimal NaN #26679
+36
−10
Conversation
| self.assertEqual(hashit(value), hashit(int(value))) | ||
|
|
||
| #the same hash that to an int | ||
| self.assertEqual(hashit(Decimal(23)), hashit(23)) |
serhiy-storchaka
Jun 11, 2021
Author
Member
Covered by tests above.
Covered by tests above.
| self.assertTrue(hashit(Decimal('Inf'))) | ||
| self.assertTrue(hashit(Decimal('-Inf'))) |
Comment on lines
-1822
to
-1823
serhiy-storchaka
Jun 11, 2021
Author
Member
Covered by tests below.
Covered by tests below.
|
|
||
| #the same hash that to an int | ||
| self.assertEqual(hashit(Decimal(23)), hashit(23)) | ||
| self.assertRaises(TypeError, hash, Decimal('sNaN')) |
serhiy-storchaka
Jun 11, 2021
Author
Member
Moved to test_hash_method_nan.
Moved to test_hash_method_nan.
|
LGTM |
9f1c5f6
into
python:main
13 checks passed
13 checks passed
|
Thanks @serhiy-storchaka for the PR |
|
GH-26706 is a backport of this pull request to the 3.10 branch. |
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Jun 13, 2021
…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
Jun 13, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


https://bugs.python.org/issue43475