Skip to content

Commit

Permalink
close #187
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaynetdinov committed Apr 13, 2017
1 parent 9c939d4 commit 5f6e6c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions trello/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ def fetch(self):
self.name = json_obj['name']
self.color = json_obj['color']
return self

def __hash__(self):
class_name = type(self).__name__
return hash(class_name) ^ hash(self.id)

def __eq__(self, other):
if isinstance(other, type(self)):
return hash(self) == hash(other)
raise NotImplementedError

0 comments on commit 5f6e6c8

Please sign in to comment.