diff --git a/plugin/core/typing.py b/plugin/core/typing.py index 0fc98b923..f4754b829 100644 --- a/plugin/core/typing.py +++ b/plugin/core/typing.py @@ -38,8 +38,15 @@ else: _T = TypeVar("_T") - class StrEnum(Type): # type: ignore - pass + class StrEnum(str, Enum): + """ + Naive polyfill for Python 3.11's StrEnum. + + See https://docs.python.org/3.11/library/enum.html#enum.StrEnum + """ + + __format__ = str.__format__ + __str__ = str.__str__ class NotRequired(Type, Generic[_T]): # type: ignore pass