FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-43475: Fix the Python implementation of hash of Decimal NaN by serhiy-storchaka · Pull Request #26679 · python/cpython · GitHub

/ cpython Public

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

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:hash-nan
Jun 12, 2021
Merged

bpo-43475: Fix the Python implementation of hash of Decimal NaN#26679
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:hash-nan

Conversation

serhiy-storchaka commented Jun 11, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Comment thread Lib/test/test_decimal.py
self.assertEqual(hashit(value), hashit(int(value)))

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Covered by tests above.

Comment thread Lib/test/test_decimal.py
Comment on lines -1822 to -1823
self.assertTrue(hashit(Decimal('Inf')))
self.assertTrue(hashit(Decimal('-Inf')))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Covered by tests below.

Comment thread Lib/test/test_decimal.py

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Moved to test_hash_method_nan.

mdickinson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

GH-26706 is a backport of this pull request to the 3.10 branch.

bedevere-bot removed the needs backport to 3.10 only security fixes label Jun 13, 2021
miss-islington pushed 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL