Re: A decorator syntax not yet mentioned (I think!)

From: Carl Banks (imbosol_at_aerojockey.com)
Date: 08/13/04


Date: 12 Aug 2004 16:11:17 -0700

Mark Bottjer <mark_bottjer@hotmail.com> wrote in message news:<411ba1db$1@nntp.zianet.com>...
> With this
> syntax, though, the decorate block changes how the def statement is
> handled, even though they are at the same indentation level.

That's a problem only if you think of decorate and def as separate
statements. If, as with if...else and try...except, you think of
decorate...def as a single statement, then there is no problem.

-- 
CARL BANKS


Relevant Pages

  • Re: Are decorators really that different from metaclasses...
    ... > If one can extend old syntax in an intuitive way, ... > definition, I see a strange use of the assignment operator, which is ... >>Maybe we just need to be clear as to which lines under the def statement ... any __xxx__ assignments immediately following the docstring. ...
    (comp.lang.python)
  • Re: Some "pythonic" suggestions for Python
    ... should we be taking suggestions from someone who needs a manual to recall the syntax of the def statement? ... It's like arguing that irregular verbs make speech less productive. ... pythonistas who make up lots of arbitrary reasons not to change ...
    (comp.lang.python)
  • Re: anonymous function objects?
    ... Why does the "print" statement return a syntax error here? ... SyntaxError: invalid syntax ... > Of course if you're trying to capture the function in a named variable ... just use a def statement. ...
    (comp.lang.python)