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.

classification
Title: lambda with a parenthesized argument raises TypeError
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: falsetru, nnorwitz
Priority: high Keywords:

Created on 2006-03-26 20:33 by falsetru, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg27880 - (view) Author: Jeong-Min Lee (falsetru) Date: 2006-03-26 20:33
==================================================
falsetru@lj-lw20 ~ $ python2.5
Python 2.5a0 (trunk:43324, Mar 26 2006, 14:18:23)
[GCC 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)] on
linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> (lambda(x): x)(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <lambda>
TypeError: unpack non-sequence
>>> (lambda(x): x)((1,))
1
>>> (lambda(x): x)((1,2))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <lambda>
ValueError: too many values to unpack
>>>




not 2.4 compatible
==================================================
falsetru@lj-lw20 ~ $ python2.4
Python 2.4.2 (#1, Oct 15 2005, 13:17:32)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on
linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> (lambda(x): x)(1)
1
>>> (lambda(x): x)((1,))
(1,)
>>> (lambda(x): x)((1,2))
(1, 2)
>>>
msg27881 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-27 08:59
Logged In: YES 
user_id=33168

Thanks for the report!  The problem was more general.  This
code also broke:  def foo((x)): 

Committed revision 43341.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43091
2006-03-26 20:33:32falsetrucreate