◐ Shell
clean mode source ↗

gh-103596: [Enum] do not shadow mixed-in methods/attributes by ethanfurman · Pull Request #103600 · python/cpython

For example:

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

    Book.author.desc is Book.desc

but

    Book.author.title() == 'Author'

Using upper-case member names means this isn't an issue in practice.

@ethanfurman added type-bug

An unexpected behavior, bug, or error

type-feature

A feature request or enhancement

stdlib

Standard Library Python modules in the Lib/ directory

3.12

only security fixes

labels

Apr 17, 2023

samypr100

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>

carljm added a commit to carljm/cpython that referenced this pull request

Apr 20, 2023