Thomas Wouters wrote:
Because (relatively) small dicts with (broadly speaking) similar keys are quite common in Python. Module and class and instance __dict__s, for instance ;) As Tim mentioned, the dict implementation only looks at part of the actual hash value (depending on the size of the dict) and having hash values close but not the same greatly decreases the chance of collisions in (relatively) small dicts.
I see--it's avoiding the Birthday Paradox. Collisions are actually more likely if the numbers are totally random than if the numbers are, because of a feeble hash algorithm, relatively consecutive. ;)

Got it, thanks,


/larry/
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to