[issue17044] Implement PEP 422: Simple class initialisation hook

Nick Coghlan report at bugs.python.org
Sun Feb 17 12:50:24 CET 2013


Nick Coghlan added the comment:

Ah, I think I see your point - because __init_class__ is supposed to be a class method on instances of the metaclass, the anchor needs to be on object (the highest level instance of the default metaclass), not on type if we don't want super to behave strangely?

I think that's a valid conclusion (albeit a very subtle difference relative to an ordinary method on type), and compared to the tapdancing we do in __new__ and __init__ to help them be valid anchors for cooperative multiple inheritance, adding object.__init_class__ is a relatively minor thing.

If you wanted to propose a patch to the PEP as well, that would be great.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17044>
_______________________________________


More information about the Python-bugs-list mailing list