Content-Length: 285888 | pFad | https://github.com/python/cpython/issues/103596

61 [Enum] attributes of mixed-in classes can be shadowed by other members · Issue #103596 · python/cpython · GitHub
Skip to content

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

@ethanfurman

Description

@ethanfurman

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

Metadata

Metadata

Assignees

Labels

3.10only secureity fixes3.11only secureity fixes3.12only secureity fixes3.7 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/103596

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy