avl._core.enum module

class avl._core.enum.Enum(*args, auto_random: bool = True, fmt: ~collections.abc.Callable[[...], ~typing.Any] = <class 'str'>)[source]
__init__(*args, auto_random: bool = True, fmt: ~collections.abc.Callable[[...], ~typing.Any] = <class 'str'>) None[source]

Initialize an enumeration variable. This class represents an enumeration variable that can take on a set of predefined values. The variable can be automatically randomized if auto_random is set to True.

Parameters:
  • value (Any) – The initial value of the variable. It should be one of the values defined in values.

  • values (dict[str, Any]) – A dictionary where keys are the names of the enumeration values and values are the corresponding values.

  • auto_random (bool) – If True, the variable can be automatically randomized. Defaults to True.

Raises:

ValueError – If the provided value is not in the list of values.