How to define a class that can act as dictionary key?

Xavier Ho contact at
Tue Sep 15 14:02:00 CEST 2009

On Tue, Sep 15, 2009 at 9:47 PM, Lambda <stephenhsu9 at> wrote:

> When I run it, it says "TypeError: unhashable instance"
> I believe you need to implement __hash__() for the class. Make sure your
class returns a unique identifier for a certain value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list