Terry J. Reedy added the comment:

The grammar presented in the doc is intentionally slightly simplified from the 
one actually used by the LL(1) parser.  The parser has to know what type of 
statement it is parsing after the first token or so, so it needs a separate 
production (concept) for statements that start with '@'.  Human readers are 
more capable and can look backwards from 'def' and 'class'.

A separate section on 'Decorated statements' would be possible, but not 
necessarily better. A section of 'Decorators' (without calling them 
'statements') would be slightly different and also possible.  Discussion would 
have to start on Python ideas and any action a separate issue.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22243>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to