Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
[#211] Add custom hash method to enable correct comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
dalepotter committed Jun 19, 2015
1 parent 7155d79 commit e587655
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iati_datastore/iatilib/codelists/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def __init__(self, cls_, name, value, description):
self.value = value
self.description = description

def __hash__(self):
return hash(self.value)

def __reduce__(self):
"""Allow unpickling to return the symbol
linked to the DeclEnum class."""
Expand Down

0 comments on commit e587655

Please sign in to comment.