Source code for py_research.enums

"""Documentation-friendly enum classes."""

from typing import Self

from strenum import LowercaseStrEnum


[docs] class StrEnum(LowercaseStrEnum): """StrEnum which renders only its value in a string context."""
[docs] @classmethod def parse(cls, value: str) -> Self: """Parse a string into a StrEnum of proper type.""" return cls(value)
def __repr__(self) -> str: # noqa: D105 return f"'{self.value}'"