22 Dec
2003
22 Dec
'03
4:29 p.m.
Would this mean that instances of the following class:
class Dummy(object): pass
would no longer be usable as dictionary keys? I guess the parts I'm not clear on are 1) whether dictionaries call the equivalent of 'hash(key)' or 'key.__hash__()', and 2) whether 'hash(Dummy())' will do something meaningful.
That class would still be usable. hash(Dummy()) sees that there's no __eq__ or __cmp__ override and then uses the default hash. --Guido van Rossum (home page: http://www.python.org/~guido/)