What are the caveats (if any) of using a class that inherits from both str
and Enum
?
This was listed as a possible way to solve the problem of Serialising an Enum member to JSON
from enum import Enum
class LogLevel(str, Enum):
DEBUG = 'DEBUG'
INFO = 'INFO'
Of course the point is to use this class as an enum, with all its advantages