[Python-checkins] CVS: python/dist/src/Lib/test test_grammar.py,1.34,1.35
Jeremy Hylton
jhylton@users.sourceforge.net
Mon, 19 Mar 2001 12:42:13 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv3928
Modified Files:
test_grammar.py
Log Message:
Add test for a list comprehension that is nested in the left-hand part
of another list comp. This caused crashes reported as SF bugs 409230
and 407800.
Note that the new tests are in a function so that the name lookup code
isn't affected by how many *other* list comprehensions are in the same
scope.
Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** test_grammar.py 2001/02/28 23:49:19 1.34
--- test_grammar.py 2001/03/19 20:42:11 1.35
***************
*** 662,665 ****
--- 662,670 ----
print test_in_func(nums)
+ def test_nested_front():
+ print [[y for y in [x, x + 1]] for x in [1,3,5]]
+
+ test_nested_front()
+
check_syntax("[i, s for i in nums for s in strs]")
check_syntax("[x if y]")