You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?The text was updated successfully, but these errors were encountered: