mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 18:33:44 +03:00
Hardcode the list of attributes to be used in comparison
Comparing Range subclasses may lead to surprises.
This commit is contained in:
parent
4545d1636c
commit
8937c635df
|
@ -140,7 +140,7 @@ class Range(object):
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
if not isinstance(other, Range):
|
if not isinstance(other, Range):
|
||||||
return NotImplemented
|
return NotImplemented
|
||||||
for attr in self.__slots__:
|
for attr in ('_lower', '_upper', '_bounds'):
|
||||||
self_value = getattr(self, attr)
|
self_value = getattr(self, attr)
|
||||||
other_value = getattr(other, attr)
|
other_value = getattr(other, attr)
|
||||||
if self_value == other_value:
|
if self_value == other_value:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user