ListEnum¶
- class ListEnum(value)[source]¶
Bases:
enum.Enum
List Enum (enum with function listing names and values)
>>> @unique >>> class TsxPolarization(ListEnum): >>> SINGLE = "S" # Single >>> DUAL = "D" # Dual >>> QUAD = "Q" # Quad >>> TWIN = "T" # Twin
Methods
Get the value list of this enum
Get the name list of this enum:
from_value
(val)Get the enum class from its value:
convert_from
(to_convert)Convert from a list or a string to an enum instance
- classmethod convert_from(to_convert: Union[list, str]) list [source]¶
Convert from a list or a string to an enum instance
>>> TsxPolarization.convert_from(["SINGLE", "S", TsxPolarization.QUAD]) [<TsxPolarization.SINGLE: 'S'>, <TsxPolarization.SINGLE: 'S'>, <TsxPolarization.QUAD: 'Q'>]
- classmethod from_value(val: Any) sertit.misc.ListEnum [source]¶
Get the enum class from its value:
>>> TsxPolarization.from_value("Q") <TsxPolarization.QUAD: 'Q'>
- Parameters
val (Any) – Value of the Enum
- Returns
Enum with value
- Return type