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 tuple parameter bus error
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: cropley_b, georg.brandl
Priority: normal Keywords:

Created on 2006-12-11 10:52 by cropley_b, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30780 - (view) Author: Bruce Cropley (cropley_b) Date: 2006-12-11 10:52
Python 2.5c1 (r25c1:51305, Aug 17 2006, 10:41:11) [MSC v.1310 32 bit (Intel)] on
 win32
Type "help", "copyright", "credits" or "license" for more information.
>>> lambda ((a,b)): 1
[... popped up windows crash reporting dialog]

Same with:

Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
>>> lambda ((a,b)): 1
Bus error


However it works with 2.4.1 and 2.3.5 on OSX and on 2.3.3 and 2.4 on Windows, e.g.:

PythonWin 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About PythonWin' for further copyright information.
>>> lambda ((a,b)): 1
<function <lambda> at 0x00AC48B0>
>>> f = lambda ((a,b)): 1
>>> assert f((1,2)) == 1
>>>

The workaround is to remove the unnecessary parentheses around the lambda's tuple of parameters:
>>> f = lambda (a,b): 1

Thanks!
msg30781 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-12-11 11:34
This has already been fixed in SVN, the fix will be part of 2.5.1. Thanks for reporting anyway!
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44325
2006-12-11 10:52:11cropley_bcreate