[Python-Dev] PEP487: Simpler customization of class creation

Nick Coghlan ncoghlan at gmail.com
Wed Jul 27 21:30:02 EDT 2016

On 28 July 2016 at 03:56, Joao S. O. Bueno <jsbueno at python.org.br> wrote:
> Otherwise, I'd suggest at least some PEP rewording to make explicit
> the fact it is not run on the class it is defined at all.  (I can help
> with that, but I'd rather see it implemented as above).

This is covered in the PEP:

> 2)
> I have another higher level concern with the PEP as well:
> It will pass all class keyword parameters, but for "metaclass" to
> "__init_subclass__" - thus making it all but impossible to any other
> keyword to the class creation machinery to ever be defined again. We
> can't think of any such other keyword now, but what might come in a
> couple of years?

This isn't a new problem, as it already exists today for custom
metaclasses. It just means introducing new class construction keywords
at the language level is something that needs to be handled
judiciously, and with a view to the fact that it might have knock-on
effects for other APIs which need to find a new parameter name.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list