[Tutor] unhashable objects (unrelated to previous topic)
Orri Ganel
singingxduck at gmail.com
Mon Mar 28 01:54:36 CEST 2005
Thanks to Jeff and John Fouhy . . . However, my question now is: can I
treat Nodes sometimes the same and sometimes not? I want to treat
Nodes whose cargo is the same the same everywhere *except* in a
dictionary, because I want the user to be able to use LinkedList in a
broader way than sets allow . . . In order to do this, I need my
__hash__() method to treat Nodes differently than the rich comparison
methods do. Is this a Bad Idea(tm) ?
--
Email: singingxduck AT gmail DOT com
AIM: singingxduck
Programming Python for the fun of it.
More information about the Tutor
mailing list