Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-111389: Add PyHASH_MULTIPLIER constant#119214
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
vstinner commented May 20, 2024 • edited by github-actions bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by github-actions bot
Uh oh!
There was an error while loading. Please reload this page.
vstinner commented May 20, 2024
The private A code search on PyPI top 7,500 projects (2024-03-16) finds 4 projects using it:
|
Uh oh!
There was an error while loading. Please reload this page.
gpshead left a comment
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.
This makes sense, no harm in this being public even if I think it is odd that anyone uses it.
vstinner commented May 20, 2024
It's a good prime number to increase to implement good hash function. Using a random number can lead to more collision. cc @mdickinson |
mdickinson commented May 21, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Change seems reasonable to me; the value is potentially useful to have available if you're implementing something complex-like in a C extension and need equality to behave well with respect to Python's |
vstinner commented May 21, 2024
I don't know about the specific case of floating point objects, but the constant is used by at least 4 projects: #119214 (comment) |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
(cherry picked from commit f6da790) Co-authored-by: Victor Stinner <vstinner@python.org>
GH-119334 is a backport of this pull request to the 3.13 branch. |
bedevere-bot commented Jun 4, 2024
|
📚 Documentation preview 📚: https://cpython-previews--119214.org.readthedocs.build/