SuperEnum
- class SuperEnum(value)[source]
Bases:
EnumBase Enum class with extended functionality.
- __init__(*args, **kwds)
Methods
keys()Returns a list of all enum names.
values()Returns a list of all enum values.
get_index_from_value(value)Gets the index of an enum member by its value.
get_index_from_string(string)Gets the index of an enum member by its string value.
- classmethod keys() list[str][source]
Returns a list of all enum names.
- Returns:
usage: [e.name for e in cls]
- Return type:
list[str]
- classmethod values() list[Any][source]
Returns a list of all enum values.
- Returns:
usage: [e.value for e in cls]
- Return type:
list[Any]
- classmethod get_index_from_value(value: Enum) int[source]
Gets the index of an enum member by its value.
- Parameters:
value (Enum) – The enum member or value.
- Returns:
The index.
- Return type:
int
- classmethod get_index_from_string(string: str) int[source]
Gets the index of an enum member by its string value.
- Parameters:
string (str) – The string string.
- Returns:
The index.
- Return type:
int