summaryrefslogtreecommitdiff
path: root/src/zope/interface/interface.py
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2011-07-05 17:06:09 +0000
committerTres Seaver <tseaver@palladion.com>2011-07-05 17:06:09 +0000
commit3724be761dad251b98dcc0bd5c6bc8419e36898d (patch)
tree2c7b8656bb117c07435c8502582cd212f186fa60 /src/zope/interface/interface.py
parenteb247a2265a61324a420506c4337021de11bcf35 (diff)
downloadzope-interface-3724be761dad251b98dcc0bd5c6bc8419e36898d.tar.gz
LP 804951: InterfaceClass instances were unhashable under Python 3.x.
Diffstat (limited to 'src/zope/interface/interface.py')
-rw-r--r--src/zope/interface/interface.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/zope/interface/interface.py b/src/zope/interface/interface.py
index ed6366d..6b2d513 100644
--- a/src/zope/interface/interface.py
+++ b/src/zope/interface/interface.py
@@ -681,6 +681,9 @@ class InterfaceClass(Element, InterfaceBase, Specification):
# This spelling works under Python3, which doesn't have cmp().
return (n1 > n2) - (n1 < n2)
+ def __hash__(self):
+ return hash((self.__name__, self.__module__))
+
def __eq__(self, other):
c = self.__cmp(self, other)
return c == 0