[Python-Dev] PEP 3135 (new super()) __class__ references broken in 3.3

Antoine Pitrou solipsis at pitrou.net
Sun May 20 15:03:21 CEST 2012


On Sun, 20 May 2012 18:51:27 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> PEP 3135 defines the new zero-argument form of super() as implicitly
> equivalent to super(__class__, <first argument>), and up until 3.2 has
> behaved accordingly: if you accessed __class__ from inside a method,
> you would receive a reference to the lexically containing class.
> 
> In 3.3, that currently doesn't work: you get NameError instead
> (http://bugs.python.org/issue14857)
> 
> While the 3.2 behaviour wasn't documented in the language reference,
> it's *definitely* documented in PEP 3135 (and my recent updates to the
> 3.3 version of the metaclass docs were written accordingly - that's
> how I discovered the problem)

The question is, do we want to support it? What's the use case?

Regards

Antoine.




More information about the Python-Dev mailing list