mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 08:56:34 +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
c10c1186a5
commit
6c27cdd20e
|
@ -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