Visitar URL original
bpo-43475: Fix the Python implementation of hash of Decimal NaN by serhiy-storchaka · Pull Request #26679 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20210613144853/https://github.com/python/cpython/pull/26679
Skip to content
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

bpo-43475: Fix the Python implementation of hash of Decimal NaN #26679

Merged
merged 1 commit into from Jun 12, 2021

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 11, 2021 •

self.assertEqual(hashit(value), hashit(int(value)))

#the same hash that to an int
self.assertEqual(hashit(Decimal(23)), hashit(23))

This comment has been minimized.

@serhiy-storchaka

serhiy-storchaka Jun 11, 2021
Author Member

Covered by tests above.

self.assertTrue(hashit(Decimal('Inf')))
self.assertTrue(hashit(Decimal('-Inf')))
Comment on lines -1822 to -1823

This comment has been minimized.

@serhiy-storchaka

serhiy-storchaka Jun 11, 2021
Author Member

Covered by tests below.


#the same hash that to an int
self.assertEqual(hashit(Decimal(23)), hashit(23))
self.assertRaises(TypeError, hash, Decimal('sNaN'))

This comment has been minimized.

@serhiy-storchaka

serhiy-storchaka Jun 11, 2021
Author Member

Moved to test_hash_method_nan.

Copy link
Member

@mdickinson mdickinson left a comment

LGTM

@serhiy-storchaka serhiy-storchaka merged commit 9f1c5f6 into python:main Jun 12, 2021
13 checks passed
13 checks passed
@github-actions
Docs
Details
@github-actions
Check for source changes
Details
@github-actions
Check if generated files are up to date
Details
@github-actions
Windows (x86)
Details
@github-actions
Windows (x64)
Details
@github-actions
macOS
Details
@github-actions
Ubuntu
Details
@github-actions
Ubuntu SSL tests with OpenSSL
Details
@github-actions
Address sanitizer Address sanitizer
Details
Azure Pipelines PR #20210611.33 succeeded
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
@bedevere-bot
bedevere/issue-number Issue number 43475 found
Details
@bedevere-bot
bedevere/news "skip news" label found
@serhiy-storchaka serhiy-storchaka deleted the serhiy-storchaka:hash-nan branch Jun 12, 2021
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 13, 2021

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jun 13, 2021

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
…6679)

(cherry picked from commit 9f1c5f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants