Is your feature request related to a problem? Please describe.
Python 3.11 has introduced some breaking changes for enums when used in f-strings.
class MyEnum(str, Enum):
VALUE = "value"
# Prior python 3.11:
print(f'{MyEnum.VALUE}')
# => "value"
# Since python 3.11:
print(f'{MyEnum.VALUE}')
# => "MyEnum.VALUE"
This behavior is different when using the new StrEnum:
from enum import StrEnum
class MyEnum(StrEnum):
VALUE = "value"
# Python 3.11:
print(f'{MyEnum.VALUE}')
# => "value"
This blog describes the problem:
https://blog.pecar.me/python-enum
Describe the solution you'd like
Add support for additional argument, or extend "--use-subclass-enum" to allow choosing between (str, Enum) and StrEnum
Or maybe even allow selecting base class for enums, for people using custom enum packages such as https://pypi.org/project/StrEnum/
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too