Is the assignment __objclass__ = enum_class in enum.py(149) needed ? I cannot find any other reference to it (even Google) and it seems that __class__ is already set to enum_class : enum_member.__objclass__ = enum_class < not sure what this is doing > I have attached a patch that forces the assignment, but would rather understand what is intended here -- and test for that.
It was originally put in to help inspect.classify_class_attrs, but recent subsequent changes (not yet committed, ), make it unnecessary. Whether or not it stays depends on the changes to inspect being committed.
Well, with all the changes to inspect to properly locate attributes in the class and metaclass mro, __objclass__ is necessary to get the home class correct (without it inspect thinks it lives in the EnumMeta metaclass).