Hrvoje Nikšić added the comment:

> The appropriate fix would probably be to add a sentence to the
> `ast.PyCF_ONLY_AST` documentation to say that some syntax errors
> are only detected when compiling the AST to a code object.

Yes, please. I'm not saying the current behavior is wrong (it makes sense that 
some constructs are legal as AST, but can't be converted into code), I just 
found it surprising. In other words, we would have found it very useful for the 
documentation to mention that code generation performs additional checks on the 
AST that are not performed during the ast.PyCF_ONLY_AST compilation.

----------

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

Reply via email to