Ethan Furman added the comment:
There are actually two signatures:
EnumCls(value) --> return member with value `value`
EnumCls(name, members, module, qualname, type, start) --> create new Enum
An example of the first:
class A(Enum):
x = 1
A(1) --> <A.x: 1>
an example of the second:
class A(Enum):
pass
B = A('B', {'y':2})
B(2) --> <B.y: 2>
The reason for the error you see is that Enums with members cannot be further
subclassed.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29363>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com