[issue43797] Improve syntax error for invalid comparisons

2021-04-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 30ed93bfec5dfa7ee05982e2df8fd810f3f49305 by Pablo Galindo in branch 'master': bpo-43797: Handle correctly invalid assignments inside function calls and generators (GH-25390) https://github.com/python/cpython/commit/30ed93bfec5dfa7ee05982

[issue43797] Improve syntax error for invalid comparisons

2021-04-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24123 pull_request: https://github.com/python/cpython/pull/25390 ___ Python tracker ___ ___

[issue43797] Improve syntax error for invalid comparisons

2021-04-12 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +24107 pull_request: https://github.com/python/cpython/pull/25375 ___ Python tracker ___ ___

[issue43797] Improve syntax error for invalid comparisons

2021-04-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset b86ed8e3bb41ede77eeab4a8bb4e2b91a8065283 by Pablo Galindo in branch 'master': bpo-43797: Improve syntax error for invalid comparisons (#25317) https://github.com/python/cpython/commit/b86ed8e3bb41ede77eeab4a8bb4e2b91a8065283 --

[issue43797] Improve syntax error for invalid comparisons

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

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +lys.nikolaou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have updated the PR with: * Works for while statements (we can make it work for other kinds of statements but is a bit tricky because those have different grammar paths. We could do this in other PRs. * I changed the error message for when the LHS

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > in invalid_named_expression, but it does not have any effect. That is because the rule for named_expressions are: named_expression[expr_ty]: | a=NAME ':=' ~ b=expression | expression !':=' | invalid_named_expression and the second al

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: These are good points, let me investigate a bit -- ___ Python tracker ___ ___ Python-bugs-

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I tried to add | a=NAME '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( a, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?") } | a=bitwise_or '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( a, "invalid syntax.

[issue43797] Improve syntax error for invalid comparisons

2021-04-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "cannot assign to name" looks wrong. Usually we can assign to name, unless it is a keyword. And the problem is not that we cannot assign to name (we can), but that is is an invalid syntax, assignment is a statement, not an expression. Seems it handles only

[issue43797] Improve syntax error for invalid comparisons

2021-04-09 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue43797] Improve syntax error for invalid comparisons

2021-04-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +24052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25317 ___ Python tracker __

[issue43797] Improve syntax error for invalid comparisons

2021-04-09 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : Improve syntax error for invalid comparisons such as: >>> if x = 3: File "", line 1 if x = 3: ^ SyntaxError: invalid syntax to print: >>> if x = 3: File "", line 1 if x = 3: ^ SyntaxError: cannot assign to name. Maybe y