Explicitly set to None to have consistent behavior in Python 2 and Python 3
This commit is contained in:
parent
940ed7e943
commit
24db3c123d
|
@ -29,8 +29,7 @@ class Code(object):
|
|||
def __eq__(self, other):
|
||||
return self.raw == other.raw
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.raw)
|
||||
__hash__ = None
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
|
|
@ -52,8 +52,7 @@ class Source(object):
|
|||
return str(self) == other
|
||||
return False
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.lines)
|
||||
__hash__ = None
|
||||
|
||||
def __getitem__(self, key):
|
||||
if isinstance(key, int):
|
||||
|
|
|
@ -1356,8 +1356,7 @@ class approx(object):
|
|||
return False
|
||||
return all(a == x for a, x in zip(actual, self.expected))
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.expected)
|
||||
__hash__ = None
|
||||
|
||||
def __ne__(self, actual):
|
||||
return not (actual == self)
|
||||
|
@ -1438,8 +1437,7 @@ class ApproxNonIterable(object):
|
|||
# Return true if the two numbers are within the tolerance.
|
||||
return abs(self.expected - actual) <= self.tolerance
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.expected, self.tolerance))
|
||||
__hash__ = None
|
||||
|
||||
def __ne__(self, actual):
|
||||
return not (actual == self)
|
||||
|
|
Loading…
Reference in New Issue