[Python-Dev] Call for defense of @decorators

Phillip J. Eby pje at telecommunity.com
Thu Aug 5 22:04:56 CEST 2004


At 03:45 PM 8/5/04 -0400, Neil Schemenauer wrote:
>On Thu, Aug 05, 2004 at 09:28:13PM +0200, Ronald Oussoren wrote:
> > On 5-aug-04, at 21:17, Gustavo Niemeyer wrote:
> > >   def funcname(...):
> > >      ...
> > >   funcname.signature = "v@:@i"
> >
> > That should be workable for this specific example.
>
>Even nicer if '_' is bound to the last function defined.
>
>     class SomeClass(objc):
>         def funcname(...):
>            ...
>         _.signature = "v@:@i"
>
>The objc metaclass could take the 'signature' function attribute and
>transform the function.
>
> > It wouldn't work for the objc.accessor example. The objc.accessor
> > function/decorator deduces the right kind of signature from the
> > name and arguments of the function.
>
>Can't the metaclass do that?

Arguing that decorators shouldn't exist isn't going to get much traction; 
the function attribute and metaclass objections have been argued to death 
numerous times previously.

If you have to raise these arguments again, please make a Wiki page so they 
can get answered at *most* once more, and then we can copy the answers from 
the Wiki into the PEP.  (This probably should have happened the first, 
second, or third times these arguments came around, and next time I will at 
least try to remember that the second time I answer the same argument I 
should darn well do so in either the PEP or the Wiki.)



More information about the Python-Dev mailing list