[Python-Dev] Multiple decorators per line

Guido van Rossum guido at python.org
Mon Aug 23 05:27:07 CEST 2004


> Are multiple decorators per line allowed in the current (pie) syntax?

Yes in the 2.4a2 release, no in the PEP and current CVS.  This was
decided quickly and with full agreement of all around shortly after a2
was released.

> Should they be? They seem to be enabled in CVS, but nobody is verbally
> promoting them, and the wiki actually points out the "single deco per
> line" as a positive feature of the current syntax (A1).

I originally thought it would be useful to have a compact form for
multiple short parameterless decorators, but in the end decided that
it wasn't worth it.

This is along the same lines of my current thinking that allowing

  if condition: statement

instead of

  if condition:
      statement

was a mistake (the statement is too hidden, especially if it's a break
or return).

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


More information about the Python-Dev mailing list