hashing an array - howto

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Sep 5 23:49:21 CEST 2008


John Machin:
> Consider this:>>> hash(123) == hash(123.0) == hash(123L)
> True

Right... Can you explain me why Python designers have chosen to build
a hash() like that?


> Try "uses all the information that is relevant to the task".

My knowledge of hash data structures seems not enough to understand
why.


> Your alternative solution using reduce and xor may have suboptimal
> characteristics ...

Right, sorry.

Bye,
bearophile



More information about the Python-list mailing list