Jeroen Demeyer <j.deme...@ugent.be> added the comment:
> The low bits are already un-improvable in the most important cases. Maybe you misunderstood me. Suppose that there is a hash collision, say hash((3, 3)) == hash((-3, -3)) and you change the hashing algorithm to fix this collision. If that change does NOT affect the lower N bits, then you still have a collision hash((3, 3)) % 2**N == hash((-3, -3)) % 2**N. This is relevant because the dict implementation starts by taking the lower bits first. So ideally we want to avoid hash collisions in the lower bits too. This may also be a reason to avoid the standard FNV multipliers: the 64-bit FNV multiplier was chosen with the full 64-bit hash range in mind. It was never meant to work well when truncated to some lower N bits. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34751> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com