mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Simplified various __eq__() methods.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user