To add more detail to the answer above,
One can make the situation work (make members of an enum work as fields of enclosing superclass)
class Color2(Enum):
RED : int = 1
BLUE : int = 2
Annotating attributes with types, means dataclass will recognize them as fields,
Source :- https://docs.python.org/3/library/dataclasses.html
The @dataclass decorator examines the class to find fields. A field is defined as a class variable that has a type annotation.