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] attributes of mixed-in classes can be shadowed by other members · Issue #103596 · python/cpython

[Enum] attributes of mixed-in classes can be shadowed by other members #103596

New issue
Copy link
New issue
Copy link
Closed
Closed
[Enum] attributes of mixed-in classes can be shadowed by other members#103596
Copy link
Assignees
ethanfurman
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard 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 Apr 17, 2023
Issue body actions

As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost:

from enum import StrEnum, auto

class Book(StrEnum):
    author = auto()
    title = auto()
    isbn = auto()

Book.author
# <Book.author: 'author'>

Book.author.title()
# book object not callable exception, but 'Author' is expected

Linked PRs

  • gh-103596: [Enum] do not shadow mixed-in methods/attributes #103600

Activity

  1. ethanfurman
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    3.11only security fixesonly security fixes
    3.10 (EOL)end of lifeend of life
    3.9 (EOL)end of lifeend of life
    3.8 (EOL)end of lifeend of life
    3.7 (EOL)end of lifeend of life
    3.12only security fixesonly security fixes
    on Apr 17, 2023
  2. ethanfurman
    self-assigned this
    on Apr 17, 2023
  3. ethanfurman commented on Apr 17, 2023

    @ethanfurman
    ethanfurman
    on Apr 17, 2023
    MemberAuthor
    More actions

    This is a long-standing issue, so not going to backport any fix.

  4. ethanfurman
    added a commit that references this issue on Apr 18, 2023

    gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)

    700ec65
  5. ethanfurman
    closed this as completedon Apr 18, 2023
  6. carljm
    added a commit that references this issue on Apr 20, 2023

    Merge branch 'main' into superopt

    5c0a21c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ethanfurman
    ethanfurman

Labels

3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard 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

No projects

    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.