A decorator syntax not yet mentioned (I think!)

Mark Bottjer mark_bottjer at hotmail.com
Thu Aug 12 13:04:43 EDT 2004


Paul McGuire wrote:
> Looking at the code, it appears that this is how the current '@'
> syntax is defined, that a funcdef is optionally preceded by a
> 'decorators' group, consisting of one or more 'decorator' (looking at
> both Grammar/Grammar and compile.c).
> 
> So I think this 'technical problem' is just conjecture.  (Should
> check with Anthony Baxter to confirm.)

It looks like they plan on getting around this "problem" by explicitly 
eating newlines whenever they match the special '@' rule. This solves 
the look-ahead problem with the parser, albeit in kind of an ugly way.

I don't have my source handy, does anything else eat newlines like this?

   -- Mark



More information about the Python-list mailing list