Samuel Ainsworth added the comment:
Also applies to list comprehensions. For example,
lst = [(lambda x: x * t) for t in range(5)]
lst[0](1) # => 4
--
___
Python tracker
<http://bugs.python.org/issu
New submission from Samuel Ainsworth:
If we construct a dict as follows,
x = {t: lambda x: x * t for t in range(5)}
then `x[0](1)` evaluates to 4! Tested on 2.7 and 3.5.
--
messages: 260287
nosy: Samuel.Ainsworth
priority: normal
severity: normal
status: open
title: lambda in dict
Changes by Samuel Ainsworth :
--
type: -> crash
___
Python tracker
<http://bugs.python.org/issue21433>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Samuel Ainsworth:
Running this:
>>> False = True
Segmentation fault: 11
gives me this:
Process: Python [17911]
Path:
/Library/Frameworks/Python.framework/Versions/3.3/Resources/Python.app/Contents/MacOS/Python
Identifier: Pytho