aboutsummaryrefslogtreecommitdiff
path: root/discord/mixins.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-19 06:18:12 -0500
committerRapptz <[email protected]>2015-12-19 06:18:12 -0500
commitf1f0e169e425ac9c849561788281e27bd8bb0acd (patch)
tree0a6d6717303c57e0902fd5dea043f2f83ff4a5e4 /discord/mixins.py
parentAdd listener for on_ready event for easier background tasks. (diff)
downloaddiscord.py-f1f0e169e425ac9c849561788281e27bd8bb0acd.tar.xz
discord.py-f1f0e169e425ac9c849561788281e27bd8bb0acd.zip
Add __slots__ where appropriate to data classes.
Diffstat (limited to 'discord/mixins.py')
-rw-r--r--discord/mixins.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/mixins.py b/discord/mixins.py
index cdbd67d7..f6f641d5 100644
--- a/discord/mixins.py
+++ b/discord/mixins.py
@@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE.
"""
class EqualityComparable:
+ __slots__ = []
+
def __eq__(self, other):
return isinstance(other, self.__class__) and other.id == self.id
@@ -34,5 +36,7 @@ class EqualityComparable:
return True
class Hashable(EqualityComparable):
+ __slots__ = []
+
def __hash__(self):
return hash(self.id)