Skip to content

StrEnum

src.utils.strings.StrEnum

Bases: str, Enum

Enum where the value is always a string.

Source code in src\utils\strings.py
53
54
55
56
57
58
59
60
61
62
63
64
65
class StrEnum(str, Enum, metaclass=StrEnumMeta):
    """Enum where the value is always a string."""

    def __str__(self) -> str:
        return self.value

    @cached_property
    def value(self) -> str:
        return str(self._value_)

    @enum_class_prop
    def Default(self) -> str:
        return "default"