tuple.__hash__()

Thomas Guettler guettli at thomas-guettler.de
Tue Jan 6 03:17:33 EST 2004


Hi!

Can someone point me to the documentation
of tuples __hash__ method?

I want to unique a list of tuples. Since
__hash__ returns a 32 bit integer, there
could be a situtation where two different tupples
return the same value.

>>> t1=(1, 2, 3)
>>> t1.__hash__()
-821448277
>>> t2=(1, 2, 3)
>>> t2.__hash__()
-821448277

Is there a dictionary type which uses __cmp__() like
btrees in the standard library?

 thomas



More information about the Python-list mailing list