From 51d91c2a82e01275d1c1d888319f1db14dc11791 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 17 Dec 2015 00:30:08 -0500 Subject: Most data classes now support hashing. --- discord/mixins.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'discord/mixins.py') diff --git a/discord/mixins.py b/discord/mixins.py index 8a11a7c1..cdbd67d7 100644 --- a/discord/mixins.py +++ b/discord/mixins.py @@ -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) -- cgit v1.2.3