aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-06-09 02:02:06 -0400
committerRapptz <[email protected]>2019-06-09 02:02:06 -0400
commit6931189b92d72b6563b73337e0e499be10aaf703 (patch)
tree864a62aadd361a1dd44dc1c74bc3757ad935ddb0
parentAdd EnumMeta.__len__ to not break user avatar code. (diff)
downloaddiscord.py-6931189b92d72b6563b73337e0e499be10aaf703.tar.xz
discord.py-6931189b92d72b6563b73337e0e499be10aaf703.zip
Add EnumMeta.__reversed__ just in case someone does this.
I sure hope not.
-rw-r--r--discord/enums.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/enums.py b/discord/enums.py
index 82371008..89da6aa6 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 __reversed__(cls):
+ return (cls._enum_member_map_[name] for name in reversed(cls._enum_member_names_))
+
def __len__(cls):
return len(cls._enum_member_names_)