Difference of hash and __hash__()

Stefan Fleiter stefan.fleiter at web.de
Tue Sep 2 20:36:21 CEST 2003


Hi,

under Python 2.2.2:

 >>> s = slice(None,5,None)
 >>> hash(s)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: unhashable type
 >>> s.__hash__()
136775584

Can anybody explain this?

Greets,
Stefan





More information about the Python-list mailing list