GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Enum] call syntax error message is confusing · Issue #92647 · python/cpython

[Enum] call syntax error message is confusing #92647

New issue
Copy link
New issue
Copy link
Closed
Closed
[Enum] call syntax error message is confusing#92647
Copy link
Assignees
ethanfurman
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

Description

@ethanfurman
ethanfurman
opened on May 10, 2022
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

  • gh-92647: [Enum] use final status to determine lookup or create #99500

Activity

  1. ethanfurman
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 10, 2022
  2. ethanfurman
    self-assigned this
    on May 10, 2022
  3. AlexWaygood
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on May 11, 2022
  4. ethanfurman
    added a commit that references this issue on Nov 15, 2022

    gh-92647: [Enum] use final status to determine lookup or create (GH-9…

    65dab15
  5. CuriousLearner
    added a commit that references this issue on Nov 16, 2022

    Merge branch 'main' into fix-issue21914

    abd206e
  6. ethanfurman
    added this to enum issueson Mar 30, 2023
  7. ethanfurman
    moved this to Research in enum issueson Mar 30, 2023
  8. ethanfurman
    moved this from Research to Check if current in enum issueson Mar 30, 2023
  9. ethanfurman
    closed this as completedon Apr 4, 2023
  10. github-project-automation
    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

  • @ethanfurman
    ethanfurman

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

Projects

  • enum issues
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.