embutils.utils.enum module

Enumeration utilities.

date

2021

author

Christian Wiche

contact

cwichel@gmail.com

license

The MIT License (MIT)

class embutils.utils.enum.IntEnum(value)[source]

Bases: enum.IntEnum

Integer enumeration class. Extends the functionalities of the base integer enumeration definition.

classmethod from_int(value: int) embutils.utils.enum.IntEnum[source]

Converts, if possible, the input value to an enum object.

Parameters

value (int) – Value to be converted.

Returns

Enumeration object.

Return type

IntEnum

Raises

ValueError – Value is not contained on the enum.

classmethod has_value(value: int) bool[source]

Checks if the input value exist on the enum definition.

Parameters

value (int) – Value to be checked.

Returns

True if exists, false otherwise.

Return type

bool