[Python-checkins] python/dist/src/Lib/test test_compile.py, 1.23, 1.24

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Oct 24 02:10:09 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30133/Lib/test

Modified Files:
	test_compile.py 
Log Message:
SF bug #1048870:  call arg of lambda not updating



Index: test_compile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- test_compile.py	31 Aug 2004 10:07:09 -0000	1.23
+++ test_compile.py	24 Oct 2004 00:10:06 -0000	1.24
@@ -252,6 +252,15 @@
         for stmt in fail:
             self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'exec')
 
+    def test_for_distinct_code_objects(self):
+        # SF bug 1048870
+        def f():
+            f1 = lambda x=1: x
+            f2 = lambda x=2: x
+            return f1, f2
+        f1, f2 = f()
+        self.assertNotEqual(id(f1.func_code), id(f2.func_code))
+
 def test_main():
     test_support.run_unittest(TestSpecifics)
 



More information about the Python-checkins mailing list