Simplified various __eq__() methods.

This commit is contained in:
Mads Jensen 2017-09-28 11:39:12 +02:00 committed by Tim Graham
parent 129f4900be
commit 4508fafe16
8 changed files with 22 additions and 29 deletions

View file

@ -1413,9 +1413,7 @@ class Prefetch:
return None
def __eq__(self, other):
if isinstance(other, Prefetch):
return self.prefetch_to == other.prefetch_to
return False
return isinstance(other, Prefetch) and self.prefetch_to == other.prefetch_to
def __hash__(self):
return hash(self.__class__) ^ hash(self.prefetch_to)