This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hniksic
Recipients docs@python, enedil, hniksic, ncoghlan
Date 2017-06-13.12:18:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497356283.03.0.969586733536.issue30637@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-06-13 12:18:03hniksicsetrecipients: + hniksic, ncoghlan, docs@python, enedil
2017-06-13 12:18:03hniksicsetmessageid: <1497356283.03.0.969586733536.issue30637@psf.upfronthosting.co.za>
2017-06-13 12:18:03hniksiclinkissue30637 messages
2017-06-13 12:18:02hniksiccreate