[Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.

Jim Jewett jimjjewett at gmail.com
Tue May 1 20:13:40 CEST 2007


On 5/1/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 10:11 AM 5/1/2007 -0400, Jim Jewett wrote:
> >On 4/30/07, Phillip J. Eby <pje at telecommunity.com> wrote:
> >> >On 4/30/07, Phillip J. Eby <pje at telecommunity.com> wrote:

> >> >>PEP 3115, however, requires that a class' metaclass be determined
> >> >>*before* the class body has executed, making it impossible to use this
> >> >>technique for class decoration any more.

...

> >>Sure -- that's what I suggested in the "super(), class decorators, and PEP
> >>3115" thread, but Guido voted -1 on adding such a magic attribute to PEP
> >>3115.

> >I don't think we're understanding each other.

> Yup, and we're still not now.  :)  Or at least, I don't understand what the
> code below does, or more precisely, why it's different from just having a
> __decorators__ list containing direct callbacks.

That would be fine too... but I thought you were saying that you
couldn't do this at all any more, because the metaclass had to be
determined before the class, instead of inside it.

Note that it doesn't have to be any particular magic name -- just one
agreed upon by the metaclass and the class author.  Today, some such
names are semi-standardized already; you don't need language support.

Why would you suddenly start needing language support after 3115?

-jJ


More information about the Python-3000 mailing list