Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document in the main Enum page that super().__new__ should not be called #115821

Closed
Labels
docsDocumentation in the Doc dir
@Gouvernathor

Description

@Gouvernathor

The HowTo page sayshere thatsuper().__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 forEnum.__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 toEnum.__new__, saying that callingsuper().__new__ inside user-defined__new__ functions is forbidden.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp