This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aroberge
Recipients aroberge, josh.r, pablogsal
Date 2021-10-12.22:28:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634077708.67.0.676459437853.issue45450@roundup.psfhosted.org>
In-reply-to
Content
+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 line in each case to be as similar to what you end up with.)

>>> set_include("why")
>>> lambda (x, y): x + y

    `lambda` does not allow parentheses around its arguments.
    This was allowed in Python 2 but it not allowed in Python 3.

>>> def foo(x, (y, z), w):

    You cannot have explicit tuples as function arguments.
    You can only use identifiers (variable names) as function arguments.
    Assign any tuple to a parameter and unpack it
    within the body of the function.
History
Date User Action Args
2021-10-12 22:28:28arobergesetrecipients: + aroberge, josh.r, pablogsal
2021-10-12 22:28:28arobergesetmessageid: <1634077708.67.0.676459437853.issue45450@roundup.psfhosted.org>
2021-10-12 22:28:28arobergelinkissue45450 messages
2021-10-12 22:28:28arobergecreate