You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I define methods ('__or__', '__and__', '__xor__', '__ror__', '__rand__', '__rxor__', '__invert__')
directly in the class inheriting from enum.Flag, these methods are "added" (mro) to the members, however, if the method is defined in the mixin, the methods defined in enum.Flag are added (e.g. Flag.__or__). I would expect methods to be called from mixin.
fromenumimportFlagclassMixin:
def__or__(self, value): ...
classMyFlag(Mixin, Flag):
passclassMyFlag2(Flag):
def__or__(self, value): ...
print(MyFlag.__or__.__qualname__) # Flag.__or__, I would expect Mixin.__or__print(MyFlag2.__or__.__qualname__) # MyFlag2.__or__ - GOOD
When I define methods
('__or__', '__and__', '__xor__', '__ror__', '__rand__', '__rxor__', '__invert__')
directly in the class inheriting from
enum.Flag
, these methods are "added" (mro) to the members, however, if the method is defined in the mixin, the methods defined inenum.Flag
are added (e.g.Flag.__or__
). I would expect methods to be called from mixin.cpython/Lib/enum.py
Lines 610 to 619 in 0898354
The text was updated successfully, but these errors were encountered: