-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
The HowTo page says here that super().__new__ should not be called in user-defined __new__ methods of an Enum (subclass), along with a short explanation for why it is the case.
But this is a hard limitation, not a bonus explanation. When I tried using the super, I ended up with an exception I didn't understand and the doc entry for Enum.__new__ didn't help me at all as per why that was failing.
The explanation should probably remain in the howto page, but a similar red warning should be added to Enum.__new__, saying that calling super().__new__ inside user-defined __new__ functions is forbidden.
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir