mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 12:44:15 +03:00
Improved fields hash, eq methods
This commit is contained in:
parent
a7f3b77eae
commit
6a377be665
|
@ -184,8 +184,7 @@ class Field(object):
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
# Needed for @total_ordering
|
# Needed for @total_ordering
|
||||||
if isinstance(other, Field):
|
if isinstance(other, Field):
|
||||||
return self.creation_counter == other.creation_counter and \
|
return self.creation_counter == other.creation_counter
|
||||||
self.object_type == other.object_type
|
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
|
@ -195,7 +194,7 @@ class Field(object):
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return hash((self.creation_counter, self.object_type))
|
return hash((self.creation_counter))
|
||||||
|
|
||||||
def __copy__(self):
|
def __copy__(self):
|
||||||
# We need to avoid hitting __reduce__, so define this
|
# We need to avoid hitting __reduce__, so define this
|
||||||
|
|
Loading…
Reference in New Issue
Block a user