[issue34339] Argument unpacking syntax for lambdas

Karthikeyan Singaravelan report at bugs.python.org
Sun Aug 5 13:22:48 EDT 2018


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

I think this is an explicit decision to remove it in Python 3 unless I am mistaking the syntax you are referring to. Please refer : https://www.python.org/dev/peps/pep-3113/ . A note on 2to3 to fix this : https://www.python.org/dev/peps/pep-3113/#transition-plan

➜  cpython git:(master) python2
Python 2.7.14 (default, Mar 12 2018, 13:54:56)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda x, (y, z): [x, y])(1, (2, 3))
[1, 2]
>>> (lambda x, (y, z): [x, y, z])(1, (2, 3))
[1, 2, 3]


➜  cpython git:(master) python3
Python 3.6.4 (default, Mar 12 2018, 13:42:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda x, (y, z): [x, y, z])(1, (2, 3))
  File "<stdin>", line 1
    (lambda x, (y, z): [x, y, z])(1, (2, 3))
               ^
SyntaxError: invalid syntax


Thanks

----------
nosy: +xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34339>
_______________________________________


More information about the Python-bugs-list mailing list