
Aug. 3, 2004
1:05 a.m.
The one thing I do dislike about the new addition is the arbitrary (?) restriction on expression allowed in a decorator. From Grammar.. decorator: '@' dotted_name [ '(' [arglist] ')' ] That seems quite odd to me. Is there some reason it couldn't be: decorator: '@' test ?
The first patch on SF actually had '@' test, and I requested that it be changed. Most things that are 'test' but not 'dotted_name' optionally followed by an argument list don't make sense as decorators; if you really have a need to write @ foo or bar def f(): ... you can write deco = foo or bar @deco def f(): ... --Guido van Rossum (home page: http://www.python.org/~guido/)