summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-05-21 17:34:50 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2003-05-21 17:34:50 (GMT)
commit4d508adae3101434ae62be1c140e9877673dc257 (patch)
treeb22ceb18bf19afd824be2fda26b89bd7079dca07 /Lib/test/test_grammar.py
parent6624e6854694315c25981f6bb6cfd360798169c5 (diff)
downloadcpython-4d508adae3101434ae62be1c140e9877673dc257.zip
cpython-4d508adae3101434ae62be1c140e9877673dc257.tar.gz
cpython-4d508adae3101434ae62be1c140e9877673dc257.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index ea0a88c..cb77727 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -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]