Pointer or unique id

Michael Hoffman cam.ac.uk at mh391.invalid
Sat Jan 15 12:16:07 EST 2005


Bruno Desthuilliers wrote:

> hash(obj) -> integer
> Return a hash value for the object.  Two objects with the same value 
> have the same hash value.  The reverse is not necessarily true, but likely.

Of course not all Python objects are hashable:

 >>> hash([])
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: list objects are unhashable
-- 
Michael Hoffman



More information about the Python-list mailing list