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, terry.reedy
Date 2017-08-29.21:39:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504042799.86.0.125756064491.issue30637@psf.upfronthosting.co.za>
In-reply-to
Content
> Can you suggest a couple of sentences you would have like to have
> seen, and where?

Thanks, I would suggest to add something like this to the documentation of ast.parse:

"""
``parse`` raises ``SyntaxError`` if the compiled source is invalid, and ``ValueError`` if the source contains null bytes. Note that a successful parse does not guarantee correct syntax of ``source``. Further syntax errors can be detected, and ``SyntaxError`` raised, when the source is compiled to a code object using ``compile`` without the ``ast.PyCF_ONLY_AST`` flag, or executed with ``exec``. For example, a lone ``break`` statement can be parsed, but not converted into a code object or executed.
"""

I don't think the ``compile`` docs need to be changed, partly because they're already sizable, and partly because they don't document individual flags at all. (A reference to the ``ast`` module regarding the flags, like the one for AST objects in the first paragraph, might be a useful addition.)
History
Date User Action Args
2017-08-29 21:39:59hniksicsetrecipients: + hniksic, terry.reedy, ncoghlan, docs@python, enedil
2017-08-29 21:39:59hniksicsetmessageid: <1504042799.86.0.125756064491.issue30637@psf.upfronthosting.co.za>
2017-08-29 21:39:59hniksiclinkissue30637 messages
2017-08-29 21:39:59hniksiccreate