A decorator syntax not yet mentioned (I think!)

Peter Hansen peter at engcorp.com
Thu Aug 12 08:43:36 EDT 2004


Carl Banks wrote:

> Well, the only thing is, whenever you see a def statement, you don't
> know if it's decorated right away, so you have to expend one or two
> extra ergs of energy to look above it and see if it is.

Well, that argument could be used against any decorator syntax,
(except those which completely obscure the def, and there would be
obvious objections to such a syntax as well).

Likewise, when you see a def, you don't know for sure right away if
it has a body, or just a big doc string, or perhaps only a pass
statement.

Neither can you tell without looking in a module whether it has
functions, classes, or just data.  Or maybe just a bunch of comments,
or many, many empty lines.  You even have to turn on the computer
before you can find the name of the file!

Damn, you mean we actually have to look at the code to figure
out what it does?!  ;-)

-Peter



More information about the Python-list mailing list