decorator J4 - any objections?

Jeff Shannon jeff at ccvcorp.com
Sat Aug 21 01:31:41 CEST 2004


Larry Bates wrote:

>If docstring can be a special case of a triple quoted
>string, I don't see why decorators couldn't be a special
>case of a dictionary.
>[...]
>
>I'm sure there is a reason, but it would seem to make
>"Python"-sense to me.  It would then be very extensible
>for the meta-data that everyone seems to also want decorators
>to support.
>  
>

The biggest reason that I'm aware of is that GvR has declared that he 
doesn't think decorators belong inside a function def, and has even been 
quoted as having professed a regret for having put docstrings there.  
(Personally, I think that having all of this stuff immediately inside 
the function def makes great sense, but I'm not a world-famous language 
designer, so what do I know? ;) )

In fact, the biggest problem that I can see with the J4 syntax is its 
close similarity to all of the decorator-inside-def variations.  Since 
GvR has spoken strongly against putting decorators in that location, it 
seems to me to be a waste of effort to advocate for that.  Now, perhaps 
having that outdented keyword to indicate the function-body start 
*might* make a difference with him...  but I would expect that it won't.

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list