Message301001
> 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.) |
|
Date |
User |
Action |
Args |
2017-08-29 21:39:59 | hniksic | set | recipients:
+ hniksic, terry.reedy, ncoghlan, docs@python, enedil |
2017-08-29 21:39:59 | hniksic | set | messageid: <1504042799.86.0.125756064491.issue30637@psf.upfronthosting.co.za> |
2017-08-29 21:39:59 | hniksic | link | issue30637 messages |
2017-08-29 21:39:59 | hniksic | create | |
|