Skip to content

Commit

Permalink
Ensure that relation Persistent.__eq__ is reflexive.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardomurri committed Apr 27, 2018
1 parent fff6526 commit cc2d8b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gc3libs/persistence/store.py
Expand Up @@ -167,6 +167,8 @@ def __str__(self):
return super(Persistable, self).__str__()

def __eq__(self, other):
if id(self) == id(other):
return True
try:
return self.persistent_id == other.persistent_id
except AttributeError:
Expand Down

0 comments on commit cc2d8b1

Please sign in to comment.