How to extend Python Enum?
Question: What is best practice for extending `Enum` type in Python 3.4 and is there
even a possibility for do this?

For example:

    
    
    from enum import Enum
    
    class EventStatus(Enum):
       success = 0
       failure = 1
    
    class BookingStatus(EventStatus):
       duplicate = 2
       unknown = 3
    
    Traceback (most recent call last):
    ...
    TypeError: Cannot extend enumerations
    

Currently there is no possible way to create a base enum class with members
and use it in other enum classes (like in the example above). Is there any
other way to implement inheritance for Python enums?


Answer: > Subclassing an enumeration is allowed only if the enumeration does not
> define any members.
>
> Allowing subclassing of enums that define members would lead to a violation
> of some important invariants of types and instances.

<https://docs.python.org/3/library/enum.html#restricted-subclassing-of-
enumerations>

So **no** , it's not directly possible.

