Decorators proposal

Jeff Shannon jeff at ccvcorp.com
Tue Aug 10 20:52:59 CEST 2004


Christopher T King wrote:

>>RebelGeekz wrote:
>>    
>>
>>>Just my humble opinion:
>>>
>>>def bar(low,high):
>>>    meta:
>>>        accepts(int,int)
>>>        returns(float)
>>>    #more code
>>>      
>>>
>
>Ooh, perty!  I especially like the extension of this idea into function
>attributes; it looks even cleaner than the .attribute syntax I like.
>
>The only problem I see with this is that Guido seems to want decorators to
>be more prominent than the function signature itself, so he probably
>certainly won't go for "hiding" then in a doubly-nested block.  
>

More to the point, GvR seems to have decided that decorators, as 
something that *wraps* a function, belong *outside* the function def 
rather than inside it.  Being inside the def implies that it's internal 
to the function, which decorators are not.

I can see the logic in that, but I really dislike the contorted prefix 
syntax that's necessary to support the alternative.

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list