>>> from functools import total_ordering
>>> @total_ordering
... class OrderedEnum(Enum):
... def __gt__(self, other):
... if self.__class__ is other.__class__:
... return self.value > other.value
... return NotImplemented
...
I believe the reader needn't be famiiar with total_ordering() to understand what's going on here.
elazar