Object equality through id

parent fa927aaf
# 0.3.0
- Two object are equals if they share the same id (`get_id`)
# 0.2.3
- Allow for a default ssl user in the client
......
......@@ -158,3 +158,10 @@ class RESTObject(object):
d.update(self.__dict__["_attrs"])
d.update(self.__dict__["_parent_attrs"])
return d
# equality via get_id
def __hash__(self):
return self.get_id().__hash__()
def __eq__(self, value):
return self.get_id() == value.get_id()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment