The enum module contains the Enum class which provides the ability to make a class act as an enumeration.
The Enum class provides the ability to create a class which acts as an enumeration. Class properties can be set as the enumeration values, and a dictionary of the entire enumeration keys and values can be retrieved.
Example:
class Test(Enum):
Prop1 = "This is a string property"
Prop2 = 123
Another = True
AnyIdName = {"test": 0}
ListId = [1, 2, 3, 4]
Calling Test.get(), returns:
{ "Prop1": "This is a string property",
"Prop2": 123,
"Another": True,
"AnyIdName": {"test": 0},
"ListId": [1, 2, 3, 4]
}
Create an Enum.