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

2021-10-04 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset f025ea23210173b42303360aca05132e4ffdfed3 by Pablo Galindo (Miss Islington (bot)) in branch '3.10': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459)

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

2021-09-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2021-09-19 Thread miss-islington
miss-islington added the comment: New changeset 41e2a31c13ba73e2c30e9bf0be9417fd17e8ace2 by Miss Islington (bot) in branch '3.9': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459)

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

2021-09-19 Thread miss-islington
miss-islington added the comment: New changeset f17c979d909f05916e354ae54c82bff71dbede35 by Miss Islington (bot) in branch '3.10': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459)

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

2021-09-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +26862 pull_request: https://github.com/python/cpython/pull/28461 ___ Python tracker ___

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

2021-09-19 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26861 pull_request: https://github.com/python/cpython/pull/28460 ___ Python tracker

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

2021-09-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset e6d05a4092b4176a30d1d1596585df13c2ab676d by Pablo Galindo Salgado in branch 'main': bpo-30637: Improve the docs of ast.parse regarding differences with compile() (GH-28459)

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

2021-09-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +26860 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/28459 ___ Python tracker

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

2021-09-06 Thread Irit Katriel
Irit Katriel added the comment: Re null in source code, see issue20115. -- ___ Python tracker ___ ___ Python-bugs-list mailing

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

2021-09-06 Thread Terry J. Reedy
Terry J. Reedy added the comment: The doc section in question is https://docs.python.org/3/library/ast.html#ast.parse I confirmed that 'break', 'continue', 'yield', and 'return' still parse, with the results how having "type_ignores=[]" added. 'Module(body=[Expr(value=Yield())],

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

2021-09-06 Thread Irit Katriel
Irit Katriel added the comment: Adding Pablo, a.k.a The King of Errors. -- nosy: +iritkatriel, pablogsal ___ Python tracker ___

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

2017-08-29 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: > 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

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

2017-06-16 Thread Terry J. Reedy
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

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

2017-06-13 Thread Hrvoje Nikšić
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

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

2017-06-13 Thread Nick Coghlan
Nick Coghlan added the comment: It's intended behaviour, but you're right that we don't explicitly document anywhere that SyntaxError can be reported from three different places: - the initial parsing based on the language Grammar - the conversion of the parse tree into the AST - the

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

2017-06-13 Thread Michał Radwański
Michał Radwański added the comment: Docs mention: ast.parse(source, filename='', mode='exec') Parse the source into an AST node. Equivalent to compile(source, filename, mode, ast.PyCF_ONLY_AST). If you just parse code into AST, you first check whether it is possible to turn such source

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

2017-06-12 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: Our application compiles snippets of user-specified code using the compile built-in with ast.PyCF_ONLY_AST flag. At this stage we catch syntax errors and perform some sanity checks on the AST. The AST is then compiled into actual code using compile() and run