Message286210
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. |
|
Date |
User |
Action |
Args |
2017-01-24 19:43:24 | ethan.furman | set | recipients:
+ ethan.furman, rhettinger, ncoghlan, larry, serhiy.storchaka, yselivanov, xiang.zhang |
2017-01-24 19:43:24 | ethan.furman | set | messageid: <1485287004.05.0.598152703086.issue29363@psf.upfronthosting.co.za> |
2017-01-24 19:43:24 | ethan.furman | link | issue29363 messages |
2017-01-24 19:43:23 | ethan.furman | create | |
|