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

[Enum] call syntax error message is confusing #92647

Closed
Assignees
ethanfurman
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@ethanfurman

Description

@ethanfurman

Using call syntax with an Enum has two possibilities:

  • creating a new enum from a previous enum (good for inheriting behavior, etc.)
  • looking up a member in a final enum

Which should be used is determined by the number of arguments: one means lookup, more than one means creation. However, if the enum was created using multiple values, and the lookup call erroneously passes multiple values instead of one tuple with those multiple values, then the creation branch is chosen and the resulting error message is less than useful.

Which branch to take should be determined by whether the enum is final (has members).

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp