As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost:
fromenumimportStrEnum, autoclassBook(StrEnum):
author=auto()
title=auto()
isbn=auto()
Book.author# <Book.author: 'author'>Book.author.title()
# book object not callable exception, but 'Author' is expected
Activity
ethanfurman commented on Apr 17, 2023
This is a long-standing issue, so not going to backport any fix.
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
Merge branch 'main' into superopt