[Python-Dev] Re: decorators and 2.4

Bill Janssen janssen at parc.com
Thu Jun 24 14:52:03 EDT 2004


Guido writes:
> One advantage mentioned by Fredrik Lundh of this, and also of my other
> favorite, over "decorators-after-args" is that the decorators are
> easily cut-and-pasted -- it's much easier to cut whole lines than
> sections of a line, and cutting a multiple-lines-spanning section is
> even worse.

Yeah, it makes the code marginally easier to edit, but it also makes
the code harder to read.  Used to be that "def" and "class" would
stand out in the file, being at the left edge.  Now you've got these
new lines, with, God help us, new syntax, cluttering up the left edge.
What's even worse, these decorators come before the function, so you
encounter them before you even know what function you're talking
about.  A reading nightmare.

I still prefer "def FUNCTION (ARGS) as DECORATOR[S]:", myself.

Bill



More information about the Python-Dev mailing list