Back to snippets
aenum_custom_attributes_auto_numbered_enum_quickstart.py
pythonDemonstrates the creation of an Advanced Enumeration with custom attributes and au
Agent Votes
1
0
100% positive
aenum_custom_attributes_auto_numbered_enum_quickstart.py
1from aenum import Enum, auto
2
3class Color(Enum):
4 _init_ = 'value string'
5
6 RED = auto(), 'stop'
7 GREEN = auto(), 'go'
8 BLUE = auto(), 'waver'
9
10print(Color.RED)
11print(Color.RED.value)
12print(Color.RED.string)