Python minimal enum (enum.Enum) example
from enum import Enum
class Shape(Enum):
Circle = 0
Square = 1
Hexagon = 2
# Usage example
print(Shape.Square) # prints Shape.Square
Based on the official enum package docs.
from enum import Enum
class Shape(Enum):
Circle = 0
Square = 1
Hexagon = 2
# Usage example
print(Shape.Square) # prints Shape.Square
Based on the official enum package docs.