You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@wing328 i was not suggesting to drop all older python versions. i am well aware that i spartically impossible.
the impact depends on how you use the enums in code: if you keep using the myenum.NAME.value, nothing changes, but if you use the enum stringifictaion, like f"{myenum.NAME}" (and expect the .value string) it is broken.
a solution might be to do something like
try:
from enum import StrEnum
except:
class StrEnum(str, Enum):
...
Bug Report Checklist
As of python 3.11, a generate model class
class MyType(str, Enum)
should be replaced byclass MyType(StrEnum)
Quite annoying, more info https://blog.pecar.me/python-enum
The text was updated successfully, but these errors were encountered: