Decorator keyword

Tuure Laurinolli tuure at laurinolli.net
Fri Aug 6 18:55:04 EDT 2004


David Fraser wrote:

> Anthony Baxter wrote:
> 
>> "with" is a non-starter - there's already other plans to use with for 
>> other
>> things, at some distant point. Also, if we're to have a new keyword, it
>> should be _much_ more obvious than 'with'.
> 
> 
> Any pointers to info on other plans for with?
> suggestions: declare
> 
> declare classmethod
> declare returns(int)
> def func(*args, **kwds):
>     return 1
> 
> Other ideas would be "decorate", but this doesn't really seem to make 
> sense (perhaps suggesting that decorators isn't the best name for them 
> :-)) or "wrap" (because they literally wrap the function, but again that 
> doesn't seem intuitive.

I was trying to find some keyword that would incorporate the name 
"decorator" somehow, but couldn't really find any (except decorate, of 
course), thus I don't think decorator is a good name for those things.

I though "use" could be good, but the function won't really use the 
functions it's decorated with, rather thay are used to describe the 
function. Keyword "describe" would make the metafunctions "descriptors", 
although the verb-as-keyword approach doesn't really work because the 
quantifiers are between the predicate and the object(decorate with 
silver and gold this tree).

Could the decorating expressions be inside the function-block?

Could there be decorating blocks inside which the function blocks would 
reside?



More information about the Python-list mailing list