Sets in Python
Piet van Oostrum
piet at cs.uu.nl
Thu Sep 20 09:14:38 EDT 2007
>>>>> Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> (SD) wrote:
>SD> In other words, if you have two mutable objects M1 and M2, then you
>SD> expect:
>SD> hash(M1) == hash(M2) if and only if M1 and M2 are equal
>SD> hash(M1) != hash(M2) if M1 and M2 are unequal
Huh? Unequal things may hash to the same value. That one of the essential
properties of a hash function.
--
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org
More information about the Python-list
mailing list