◐ Shell
clean mode source ↗

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

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