-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9only security fixesonly security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
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 security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9only security fixesonly security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error