[Python-ideas] An even simpler customization of class creation

Nick Coghlan ncoghlan at gmail.com
Sun Mar 8 13:28:57 CET 2015


On 7 March 2015 at 00:11, Mark Young <marky1991 at gmail.com> wrote:
> Is that documented somewhere? I have never heard of that functionality.

The implicit __class__ cell? PEP 3135 introduced the ability to call
super() without any arguments in Python 3 to ask the interpreter to
just "do the right thing": https://www.python.org/dev/peps/pep-3135/

The actual language reference docs are here:
https://docs.python.org/3/reference/datamodel.html#creating-the-class-object

Cheers,
Nick.

P.S. Those language reference class creation docs weren't fully
updated for the original Python 3.0 release. They were updated in 3.3
when the new dynamic type creation APIs were added to the types module
to simplify PEP 3115 compliant dynamic type creation:
https://docs.python.org/3/library/types.html#dynamic-type-creation


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


More information about the Python-ideas mailing list