[Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc. (original) (raw)
Phillip J. Eby pje at telecommunity.com
Tue May 1 20:51:58 CEST 2007
- Previous message: [Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.
- Next message: [Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 02:13 PM 5/1/2007 -0400, Jim Jewett wrote:
On 5/1/07, Phillip J. Eby <pje at telecommunity.com> wrote: > 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.
Correct.
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?
Because it eliminated an existing magic name: metaclass. Under the old regime, you could simply replace metaclass with a function that called the old metaclass, then applied any desired decoration to the result.
A decorators hook would replace this hack with something less convoluted, and allow method decorators and attribute descriptors a chance to modify the class, if needed. (For example, the @abstractmethod could ensure the class was abstract, or raise an error if the class wasn't explicitly declared abstract.)
- Previous message: [Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.
- Next message: [Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]