[Python-Dev] Possible rough edges in Python 3 metaclasses (was Re: Language reference updated for metaclasses)

Joao S. O. Bueno jsbueno at python.org.br
Tue Jun 5 14:21:39 CEST 2012


On 4 June 2012 21:10, PJ Eby <pje at telecommunity.com> wrote:

>> > I only use __metaclass__ in 2.x for this because it's the only way for
>> > code
>> > executed in a class body to gain access to the class at creation time.
>> >

PJ,
it maybe just me, but what does this code do that can't be done at the
metaclass' __new__ method?

You might have to rewrite some method-decorators, so that they just
mark a method at class body execution time, and then, whatever the
decorator used to do at this time, would be done at meta's __new__ - I
have this working in some code (and in Python 2 already).

   js
  -><-


More information about the Python-Dev mailing list