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

Appearance settings

[Enum] call syntax error message is confusing #92647

Copy link
Copy link
@ethanfurman

Description

@ethanfurman
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
No fields configured for issues without a type.

Projects

Status
Done
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.