[Python-Dev] Re: PEP 318: Decorators last before colon

Guido van Rossum guido at python.org
Wed Mar 31 10:42:32 EST 2004


> > Taking the prefix position as given for the moment, why overload list
> > literal syntax versus something currently illegal and meaningless?  
> > Such as
> >
> > <decorator>      # almost as easy, or
> 
> Yes. This looks better and will make it more clear that it's a special 
> case. Otherwise the decorators will look too decoupled from the 
> function.

Why does <...> look better than [...]?  To me, <...> just reminds me
of XML, which is totally the wrong association.

There are several parsing problems with <...>: the lexer doesn't see <
and > as matched brackets, so you won't be able to break lines without
using a backslash, and the closing > is ambiguous -- it might be a
comparison operator.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list