Visitar URL original
[Enum] call syntax error message is confusing · Issue #92647 · python/cpython · GitHub
Skip to content

[Enum] call syntax error message is confusing #92647

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

Activity

  1. self-assigned this
    on May 10, 2022
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on May 11, 2022
  3. added a commit that references this issue on Nov 15, 2022
  4. moved this to Research in enum issueson Mar 30, 2023
  5. moved this from Research to Check if current in enum issueson Mar 30, 2023
  6. moved this from Check if current to Done in enum issueson Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions