PEP318: radical notion

Christophe Cavalaria chris.cavalaria at free.fr
Wed Aug 25 00:57:41 CEST 2004


Arien Malec wrote:

> Christophe Cavalaria <chris.cavalaria at free.fr> wrote in message
> news:<412a4222$0$293$626a14ce at news.free.fr>...
>> Arien Malec wrote:
> 
>> > 1) Make PEP318 *only* implement problem (1). That is, create sematics
>> > for defining and retrieving function/method/class metadata
>> > 2) Create a new default metaclass that uses metadata for class/static
>> > method definitions to perform the necessary class/staticmethod
>> > transformations. Perhaps use this metaclass as default in 2.4 only via
>> > a "from __future__ import foo".
>> > 3) Leave any arbitrary transformations to be implemented via custom
>> > metaclasses -- these metaclasses will have access to the custom
>> > metadata to trigger method def transformations.
> 
>> Unfortunately for you, you can use decorators on normal functions and not
>> only on member functions. It rules out any metaclass based
>> implementation.
> 
> Is there a valid use case that supports arbitrary magical non-metadata
> transformations of standalone functions?
> 
> Arien

memoize for example. No metadata, only transformation, doesn't really apply
to a member function in fact ( although it might be possible à

Why is it that there are always some people who doesn't understand all the
possibilities of decorators and so want to minimise their usefulness ?



More information about the Python-list mailing list