[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-12 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset c9a71dd223c4ad200a97aa320aef6bd3d45f8897 by Benjamin Peterson in branch 'master': closes bpo-34641: Further restrict the LHS of keyword argument function call syntax. (GH-9212)

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Tested the patch. ➜ cpython git:(master) ✗ ./python.exe Python 3.8.0a0 (heads/master-dirty:731ff68eee, Sep 12 2018, 11:40:16) [Clang 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-12 Thread Benjamin Peterson
Change by Benjamin Peterson : -- keywords: +patch pull_requests: +8644 stage: -> patch review ___ Python tracker ___ ___

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please create a PR Benjamin? And please keep the comment about special casing lambda. See also issue30858 about the wording of the error message. -- ___ Python tracker

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: There seems to be some of the similar cases that have tests added as part of c960f26044edaea6669e60859ecf590c63c65e62 and the original error message added at 3e0055f8c65c407e74ce476b8e2b1fb889723514. Existing tests : >>> f(x()=2) Traceback (most

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Benjamin Peterson
Benjamin Peterson added the comment: I expect you'd have to make the check of test nodes in ast.c stricter. Here's a slightly gross implementation of that: diff --git a/Python/ast.c b/Python/ast.c index 94962e00c7..b7cebf4777 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -2815,15 +2815,22

[issue34641] Curiosity: f((a)=1) is not a syntax error -- why?

2018-09-11 Thread Guido van Rossum
New submission from Guido van Rossum : Emily and I just discovered that f((a)=1) is accepted and compiled the same as f(a=1). This goes against the intention that keyword arguments have the syntax f(NAME=expr). I suspect that this behavior was introduced at the time we switched from