How to extend Python Enum?

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/howto/enum.html#restricted-enum-subclassing

So no, it’s not directly possible.

Leave a Comment