[Tutor] Decorators

Alan Gauld alan.gauld at freenet.co.uk
Tue Apr 11 18:43:10 CEST 2006


>> There is no practical use for decorators IMHO
> It's true that decorators are syntactic sugar and don't add any new 
> functional capabilities to the language.

Which is all I intended to imply.

> However this doesn't mean that there is no practical use for decorators. 

Nor did I mean that, after all I am a big advocate of lambdas and 
they too are sugar. They have no practical use but are nice for 
conveying certain concepts in code. Similarly with decorators
(although I do hate the syntax!)

> After all, list comprehension is mostly syntactic sugar too! 

Absolutely and also add no practical functionality they are just 
shorthand, albeit with a small performance advantage in many 
cases - which is not true of decorators or lambdas!

> proposal for dynamic function overloading:
> http://www.artima.com/weblogs/viewpost.jsp?thread=155514

I really don't like this proposal nor many of the others that currently 
exist to seemingly turn Python into Java and C++! If people want to 
code in the Java porridge let them use Java not try to turn Python 
into the same sludge. (And yes, I do realise that it's Guido who's 
doing the work in this case! :-)

Alan G.


More information about the Tutor mailing list