mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Simplified various __eq__() methods.
This commit is contained in:
parent
129f4900be
commit
4508fafe16
8 changed files with 22 additions and 29 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue