[Python-Dev] PEP 422: Simpler customisation of class creation

Ethan Furman ethan at stoneleaf.us
Sun Sep 15 16:19:32 CEST 2013

Three questions:

Would the new __initclass__ function be usable with actual full-blown metaclasses?

The PEP says this:
> If present on the created object, this new hook will be called by the class creation machinery after the __class__ reference has been initialised.

Given that statement, and this example:

     class A:
         def __initclass__(cls):
             # do stuff

     class B(A):

am I correct that A's __initclass__ will not run when B is created?

Where are we at with being ready for pronouncement?


More information about the Python-Dev mailing list