"TypeError: unhashable type: 'InterfaceClass'" in Python 3
Bug #804951 reported by
Facundo Batista
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zope.interface |
Fix Released
|
Undecided
|
Tres Seaver |
Bug Description
I got this after installing zope.interface 3.6.3 from the tarball.
The problem is that InterfaceClass defines __eq__ but not __hash__.
I workarounded the problem by adding a
def __hash__(self):
return id(self)
...but I don't know if it's a proper solution.
Regards,
To post a comment you must log in.
I don't think 'id(self)' is the right hash value: items which compare equal are also supposed to have the same hash value. Likely we should be using the hash of the fully-qualified name.