diff options
author | Raymond Hettinger <python@rcn.com> | 2004-10-24 00:10:06 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-10-24 00:10:06 (GMT) |
commit | 9047c8f73d0e8c865452f80a4219d647be7c433a (patch) | |
tree | ee43ced8c934a7477d2025291774d667495a8bad /Lib/test/test_compile.py | |
parent | 7cb13a971d6dc0feb50393a4c9a930928253a940 (diff) | |
download | cpython-9047c8f73d0e8c865452f80a4219d647be7c433a.zip cpython-9047c8f73d0e8c865452f80a4219d647be7c433a.tar.gz cpython-9047c8f73d0e8c865452f80a4219d647be7c433a.tar.bz2 |
SF bug #1048870: call arg of lambda not updating
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 5011d03..c567fa4 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -252,6 +252,15 @@ if 1: 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) |