[Python-ideas] Ruby-style Blocks in Python Idea

Terry Reedy tjreedy at udel.edu
Mon Mar 9 22:26:11 CET 2009


Guido van Rossum wrote:

>> For precedence let's take a look at decorators. Fundamentally,
>> decorators save a user nothing more than a single line of code.
> 
> I guess you weren't there at the time. If it was about saving a line
> of code it would have been boohed out of the room. (Especially since
> the line count is actually the same with or without using the
> decorator syntax!) The big improvement that decorators offer is to
> move the "decoration" from the end of the function body, where it is
> easily missed, to the front of the declaration, where it changes the
> emphasis for the reader. I don't see a similar advantage in your
> example; it looks more like "Ruby-envy" to me.

Plus decorators save 2 retypings of the function name, which was 
especially important for people who use very_long_multi_word_func_names.




More information about the Python-ideas mailing list