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

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Apr 5 02:01:04 EDT 2004


"Phillip J. Eby" <pje at telecommunity.com>:

> There are different kinds of aesthetics.  Guido's proposal has grown on me 
> from a *visual* aesthetics point of view.  After I worked with it a little 
> bit, I realized it really is much prettier than decorators-before-colon.

Your tastes must be different from mine, then, because
it doesn't strike me as any prettier visually, either.

I don't think I can fully separate these different kinds of
aesthetics in my mind, anyway. To me, a piece of syntax
isn't just something to look at -- it has a grammar, and
it has a meaning, and if the grammar and the meaning and
the way it looks on the page don't all agree with each
other, it strikes a discordant note.

When I read the syntax

  def foo(args) [classmethod]:
    ...

it says to me "Define a function foo, with these args, and
which happens to be a classmethod. Here's the body..."

On the other hand, when I see

  [classmethod]
  def foo(args):
    ...

the little voice in my head doesn't really say anything
coherent at all.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list