A decorator syntax not yet mentioned (I think!)
Greg Ewing
greg at cosc.canterbury.ac.nz
Fri Aug 13 00:40:58 EDT 2004
Carl Banks wrote:
> One thing that's different is that, in all those cases, the second
> block has a keyword that can't appear alone. You can't have an except
> without a try, or an else without an if, but you could have a def
> without a decorate.
So maybe the def should come first...
def:
staticmethod
author("Fred")
decorated foo(blarg):
...
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list