Most data classes now support hashing.

This commit is contained in:
Rapptz
2015-12-17 00:30:08 -05:00
parent 613214f197
commit 51d91c2a82
8 changed files with 38 additions and 9 deletions

View File

@ -32,3 +32,7 @@ class EqualityComparable:
if isinstance(other, self.__class__):
return other.id != self.id
return True
class Hashable(EqualityComparable):
def __hash__(self):
return hash(self.id)