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

Possibly incorrect hash for ImmutableMultiDict #118

Closed
SimonSapin opened this issue Sep 29, 2011 · 0 comments
Closed

Possibly incorrect hash for ImmutableMultiDict #118

SimonSapin opened this issue Sep 29, 2011 · 0 comments

Comments

@SimonSapin
Copy link
Contributor

The use of enumerate() in ImmutableMultiDictMixin is necessary for ImmutableOrderedMultiDict, but for ImmutableMultiDict it might make the hash incorrect:

The order of items from dict.iteritems() is not guaranteed. If two dicts give items in a different order they would get two different hashes, which is wrong if they compare equal. However, I never managed to get two such dicts.

It might be that iteritems yield in key hash order, so this problem can never happen. Is it the case? Is it a CPython implementation detail or something we can rely on?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants