[Python-Dev] Questions about '@' in pep 318

M.-A. Lemburg mal at egenix.com
Fri Aug 6 17:35:02 CEST 2004


Phillip J. Eby wrote:
> At 01:07 PM 8/6/04 +0200, M.-A. Lemburg wrote:
> 
>> 1. Instead of trying to overgeneralize, we only allow exactly
>>    *one* decorator per function definition.
> 
> 
> Not practical.  Since many use cases for multiple decorators exist, 
> restricting the syntax to one simply pushes the issue into functions to 
> combine decorators, further decreasing readability.
> 
> 
>> 2. Since decorators change the definition of a function, that
>>    one decorator call is placed directly after the "def" and
>>    before the function name.
> 
> 
> This makes it difficult to e.g. grep for 'def functionname', and will 
> confuse the heck out of simplistic code scanners, not to mention Tim 
> Peters.  :)

Please read my entire post. Here's the grep pattern to
use: "def( \w+)? funcname".

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 06 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list