[Python-checkins] python/dist/src/Lib/test test_grammar.py,1.45,1.46

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Wed, 21 May 2003 10:34:52 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv10692/Lib/test

Modified Files:
	test_grammar.py 
Log Message:
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.


Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** test_grammar.py	12 Feb 2003 16:57:31 -0000	1.45
--- test_grammar.py	21 May 2003 17:34:50 -0000	1.46
***************
*** 702,705 ****
--- 702,706 ----
  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):