We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94e1696 commit b44c516Copy full SHA for b44c516
Misc/NEWS.d/next/Core and Builtins/2018-01-14-20-32-47.bpo-26163.xv9Iuv.rst
@@ -0,0 +1,2 @@
1
+Improved frozenset() hash to create more distinct hash values when faced
2
+with datasets containing many similar values.
Objects/setobject.c
@@ -795,6 +795,7 @@ frozenset_hash(PyObject *self)
795
hash ^= ((Py_uhash_t)PySet_GET_SIZE(self) + 1) * 1927868237UL;
796
797
/* Disperse patterns arising in nested frozensets */
798
+ hash ^= (hash >> 11) ^ (~hash >> 25);
799
hash = hash * 69069U + 907133923UL;
800
801
/* -1 is reserved as an error code */
0 commit comments