Armin Rigo added the comment:

Wrong, sorry.  On a 32-bit Python 2.7, "(2**32-1)*n" has the same hash -2, for 
any value of n.

Of course if you build a dict containing thousands of such integers as keys, 
then right now you get unexpectedly bad performance.  I wonder if I should open 
another bug report about that --- the hash of longs should be slightly more 


Python tracker <>
Python-bugs-list mailing list

Reply via email to