This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients ethan.furman, larry, ncoghlan, rhettinger, serhiy.storchaka, xiang.zhang, yselivanov
Date 2017-01-24.19:43:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485287004.05.0.598152703086.issue29363@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-01-24 19:43:24ethan.furmansetrecipients: + ethan.furman, rhettinger, ncoghlan, larry, serhiy.storchaka, yselivanov, xiang.zhang
2017-01-24 19:43:24ethan.furmansetmessageid: <1485287004.05.0.598152703086.issue29363@psf.upfronthosting.co.za>
2017-01-24 19:43:24ethan.furmanlinkissue29363 messages
2017-01-24 19:43:23ethan.furmancreate