1 """Helpers for working with enums."""
3 from collections.abc
import Callable
6 from typing
import TYPE_CHECKING, Any
11 def lru_cache[_T: Callable[..., Any]](func: _T) -> _T:
12 """Stub for lru_cache."""
15 from functools
import lru_cache
19 def try_parse_enum[_EnumT: Enum](cls: type[_EnumT], value: Any) -> _EnumT |
None:
20 """Try to parse the value into an Enum.
22 Return None if parsing fails.
24 with contextlib.suppress(ValueError):