Decorator syntax

C. Barnes connellybarnes at yahoo.com
Wed Aug 4 21:42:48 EDT 2004


I vote for

def f(): [synchronized, classmethod]
  (body of function)

This is backwards compatible (Python <= 2.3 raise
SyntaxError), and looks much nicer than @.

The only problem is that you can't one-line a
decorated function.  You can't do that with
the @ notation either, so it's not a big deal.

 - Connelly



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the Python-list mailing list