Commit f4703ca5 authored by Philipp Arras's avatar Philipp Arras
Browse files

Fully implement __eq__

parent 84c4d1e7
......@@ -185,7 +185,7 @@ class DomainTuple(object):
return self._dom.__hash__()
def __eq__(self, x):
return (self is x) or (self._dom == x._dom)
return (self is x) or (isinstance(x, DomainTuple) and self._dom == x._dom)
def __ne__(self, x):
return not self.__eq__(x)
......
......@@ -103,7 +103,7 @@ class MultiDomain(object):
def __eq__(self, x):
if self is x:
return True
return list(self.items()) == list(x.items())
return isinstance(x, MultiDomain) and list(self.items()) == list(x.items())
def __ne__(self, x):
return not self.__eq__(x)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment