mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 00:46:33 +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):
|
||||
if not isinstance(other, Range):
|
||||
return NotImplemented
|
||||
for attr in self.__slots__:
|
||||
for attr in ('_lower', '_upper', '_bounds'):
|
||||
self_value = getattr(self, attr)
|
||||
other_value = getattr(other, attr)
|
||||
if self_value == other_value:
|
||||
|
|
Loading…
Reference in New Issue
Block a user