[issue30637] Syntax error reported on compile(...), but not on compile(..., ast.PyCF_ONLY_AST)

Terry J. Reedy report at bugs.python.org
Fri Jun 16 21:45:01 EDT 2017


Terry J. Reedy added the comment:

Python grammar is constrained to be, I believe, LL(1).  Whatever the constraint is, there are a few syntax rules that either cannot be written or would be difficult to write within the constraint.  So they are checked during compilation.  Can you suggest a couple of sentences you would have like to have seen, and where?

I might also note that not all exceptions raised by compile are literally 'SyntaxError's.

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30637>
_______________________________________


More information about the Python-bugs-list mailing list