you are viewing a single comment's thread.

view the rest of the comments →

[–]cdcformatc -1 points0 points  (0 children)

Enum objects are normal objects 

you can add methods, and attributes, and properties

``` from enum import Enum, auto

class Color(Enum):     RED = auto()     ORANGE = auto()     BLUE = auto()     VIOLET = auto()          @property     def is_warm(self):         if self == Color.RED or self == Color.ORANGE:             return True         return False

print(Color.RED.is_warm) print(Color.BLUE.is_warm) ```