Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix usize not using the same hash as PyInt when used as key into a di… #5756

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

Merged
merged 7 commits into from
May 1, 2025

Conversation

hbina
Copy link
Contributor

@hbina hbina commented Apr 29, 2025

…ctionary

common/src/hash.rs Outdated Show resolved Hide resolved
@hbina hbina force-pushed the hbina-fix-hash-usize branch from 4e8d34d to 78809a5 Compare April 30, 2025 13:19
extra_tests/snippets/builtin_object.py Outdated Show resolved Hide resolved
@@ -86,6 +86,11 @@ pub fn hash_pointer(value: usize) -> PyHash {
hash as _
}

#[inline]
pub fn hash_integer<T: num_traits::PrimInt>(data: T) -> PyHash {
Copy link
Member

Choose a reason for hiding this comment

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

To avoid unnecessarily complicated error handlings, pub fn hash_usize(data: usize) will be enough.
Let's place this function beside hash_bigint to find each other easier

common/src/hash.rs Outdated Show resolved Hide resolved
common/src/hash.rs Outdated Show resolved Hide resolved
vm/src/dict_inner.rs Outdated Show resolved Hide resolved
@youknowone youknowone merged commit 253cc4e into RustPython:main May 1, 2025
@youknowone
Copy link
Member

uh, CI didn't run for last fix

@youknowone youknowone mentioned this pull request May 1, 2025
@hbina hbina deleted the hbina-fix-hash-usize branch May 1, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.