mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix for SF [ 734869 ] Lambda functions in list comprehensions
The compiler was reseting the list comprehension tmpname counter for each function, but the symtable was using the same counter for the entire module. Repair by move tmpname into the symtable entry. Bugfix candidate.
This commit is contained in:
parent
6624e68546
commit
4d508adae3
5 changed files with 27 additions and 15 deletions
|
@ -701,6 +701,7 @@ print [3 * x for x in nums]
|
|||
print [x for x in nums if x > 2]
|
||||
print [(i, s) for i in nums for s in strs]
|
||||
print [(i, s) for i in nums for s in [f for f in strs if "n" in f]]
|
||||
print [(lambda a:[a**i for i in range(a+1)])(j) for j in range(5)]
|
||||
|
||||
def test_in_func(l):
|
||||
return [None < x < 3 for x in l if x > 2]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue