Andre Roberge <andre.robe...@gmail.com> 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 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to