[issue45450] Improve syntax error for parenthesized arguments

2021-11-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 7a1d9325287a39528b795b1e8037146777abfe3e by Pablo Galindo Salgado in branch 'main': bpo-45450: Improve syntax error for parenthesized arguments (GH-28906) https://github.com/python/cpython/commit/7a1d9325287a39528b795b1e8037146777abfe3e

[issue45450] Improve syntax error for parenthesized arguments

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

[issue45450] Improve syntax error for parenthesized arguments

2021-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Note that the first error is adding invalid outer parens, whereas the second > is adding inner parens for sublist. Yeah, but you can also write: lambda x, (y, z), w: None So is kind of the same error -- __

[issue45450] Improve syntax error for parenthesized arguments

2021-10-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: I suggest "Lambda expression parameters ...". Keep "Function parameters ..." for the other. Note that the first error is adding invalid outer parens, whereas the second is adding inner parens for sublist. -- nosy: +terry.reedy

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Andre Roberge
Andre Roberge added the comment: +1 on adding better error messages for these cases. I also agree with having different explanations with lambda and def. Below is what I have with friendly-traceback: perhaps the first line of both of these might be suitable? (I will likely change the first

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: With PR 28906 it will show: >>> def foo(x,y,(z,w),k): File "", line 1 def foo(x,y,(z,w),k): ^ SyntaxError: Function parameters cannot be parenthesized I am happy to take suggestions for the wording -- ___

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > so just saying "Function parameters cannot be parenthesized" seems very weird. I agree that the wording can be improved, but is not weird, it has the same problem in functions: >>> def foo(x,y,(z,w),k): File "", line 1 def foo(x,y,(z,w),k):

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Josh Rosenberg
Josh Rosenberg added the comment: Why not "lambda parameters cannot be parenthesized" (optionally "lambda function")? def-ed function parameters are parenthesized, so just saying "Function parameters cannot be parenthesized" seems very weird. -- nosy: +josh.r ___

[issue45450] Improve syntax error for parenthesized arguments

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

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +27197 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28906 ___ Python tracker __

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Example: >>> lambda (x,y,z): x+y+z File "", line 1 lambda (x,y,z): x+y+z ^^^ SyntaxError: Function parameters cannot be parenthesized -- ___ Python tracker

[issue45450] Improve syntax error for parenthesized arguments

2021-10-12 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : There is a non-trivial ammount of users that try to parenthesize lambda parameters: >>> lambda (x,y,z): x+y+z File "", line 1 lambda (x,y,z): x+y+z ^ SyntaxError: invalid syntax We should improve the error message in this case