Skip to content

Commit 4d691ab

Browse files
committed
cqle: Simplify Model __eq__ a little
1 parent ab2a978 commit 4d691ab

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

cassandra/cqlengine/models.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,7 @@ def __eq__(self, other):
492492
if keys != other_keys:
493493
return False
494494

495-
# check that all of the attributes match
496-
for key in other_keys:
497-
if getattr(self, key, None) != getattr(other, key, None):
498-
return False
499-
500-
return True
495+
return all(getattr(self, key, None) == getattr(other, key, None) for key in other_keys)
501496

502497
def __ne__(self, other):
503498
return not self.__eq__(other)

0 commit comments

Comments
 (0)