Add EnumMeta.__len__ to not break user avatar code.
This commit is contained in:
parent
af4e3ad79b
commit
a92b4c2093
@ -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__
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user