[ python-Bugs-1613059 ] lambda tuple parameter bus error

SourceForge.net noreply at sourceforge.net
Mon Dec 11 12:34:54 CET 2006


Bugs item #1613059, was opened at 2006-12-11 10:52
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1613059&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.5
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Bruce Cropley (cropley_b)
Assigned to: Nobody/Anonymous (nobody)
Summary: lambda tuple parameter bus error

Initial Comment:
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 at 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!


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-12-11 11:34

Message:
Logged In: YES 
user_id=849994
Originator: NO

This has already been fixed in SVN, the fix will be part of 2.5.1. Thanks
for reporting anyway!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1613059&group_id=5470


More information about the Python-bugs-list mailing list