aenum icon indicating copy to clipboard operation
aenum copied to clipboard

Direct support ABC/Protocol mixin

Open tokarenko opened this issue 2 years ago • 0 comments

I suggest to add direct support of abstract base classes and protocols mixins to aenum (and stdlib enum if possible).

Currently addition of ABC/Protocol mixin to Enum raises errors:

  • For ABC : "TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases"
  • For Protocols: "TypeError: Protocols cannot be instantiated"

and require workarounds. As far as I know there are no workaround for Protocol mixin (if one wants to explicitly indicate implementation in Enum).

tokarenko avatar Nov 26 '23 12:11 tokarenko