aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-06-09 01:59:23 -0400
committerRapptz <[email protected]>2019-06-09 01:59:23 -0400
commita92b4c2093433afab5625460a525ccf869db1671 (patch)
tree4f9df1435de46a6c1a08dce538e4638ba4d12265
parentSome documentation touch-ups and missing stuff in the changelog. (diff)
downloaddiscord.py-a92b4c2093433afab5625460a525ccf869db1671.tar.xz
discord.py-a92b4c2093433afab5625460a525ccf869db1671.zip
Add EnumMeta.__len__ to not break user avatar code.
-rw-r--r--discord/enums.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/enums.py b/discord/enums.py
index 218f3356..82371008 100644
--- a/discord/enums.py
+++ b/discord/enums.py
@@ -97,6 +97,9 @@ class EnumMeta(type):
def __iter__(cls):
return (cls._enum_member_map_[name] for name in cls._enum_member_names_)
+ def __len__(cls):
+ return len(cls._enum_member_names_)
+
def __repr__(cls):
return '<enum %r>' % cls.__name__