[issue34751] Hash collisions for tuples

Tim Peters report at bugs.python.org
Tue Oct 2 15:37:22 EDT 2018


Tim Peters <tim at python.org> added the comment:

> If we, e.g., tested tuples of little floats instead ...

Speaking of which:

>>> from itertools import product
>>> len(set(map(hash, product([0.5, 0.25], repeat=20))))
32

32 hash codes out of 1048576 distinct two-tuples isn't exactly confidence-inspiring either ;-)  No scheme that only "propagates to the left" is going to help that much, because the variation in those hashes is all in the high-order bits.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34751>
_______________________________________


More information about the Python-bugs-list mailing list