MediaRouter / app /core /enums.py
basyx's picture
Upload 238 files
a34bdcd verified
Raw
History Blame Contribute Delete
556 Bytes
"""Enum compatibility helpers for the supported Python 3.10+ runtimes."""
from __future__ import annotations
from enum import Enum
class StrEnum(str, Enum):
"""String-valued enum with the Python 3.11 ``enum.StrEnum`` behavior.
MediaRouter supports Python 3.10, where the standard-library StrEnum does
not exist. Keeping this small compatibility type in one place gives API,
database, and Pydantic serialization the same string behavior on every
supported runtime.
"""
__str__ = str.__str__
__format__ = str.__format__