This commit is contained in:
Christian Mantha
2026-03-02 19:10:52 -05:00
commit 2ca0b9ef7c
28907 changed files with 5233713 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
"""Enum-related utilities, including backports for older Python versions."""
from __future__ import annotations
from enum import Enum
__all__ = ["StrEnum"]
# StrEnum is only available in Python 3.11+
try:
from enum import StrEnum
except ImportError:
class StrEnum(str, Enum):
"""
Minimal backport of Python 3.11's StrEnum for older versions.
An Enum where all members are also strings.
"""
def __str__(self) -> str:
return self.value