diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-28 15:55:58 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-28 15:55:58 (GMT) |
commit | d16f57bf4db4417c8d7a038a0b61bb24461cd64a (patch) | |
tree | f8b2164259eea6a713daf136a1fed649efd0f606 /Lib/test | |
parent | c63392c15205607610957e243824da9baba3f62f (diff) | |
download | cpython-d16f57bf4db4417c8d7a038a0b61bb24461cd64a.zip cpython-d16f57bf4db4417c8d7a038a0b61bb24461cd64a.tar.gz cpython-d16f57bf4db4417c8d7a038a0b61bb24461cd64a.tar.bz2 |
Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_copy.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py index ccbd231..823e9b3 100644 --- a/Lib/test/test_copy.py +++ b/Lib/test/test_copy.py @@ -672,6 +672,17 @@ class TestCopy(unittest.TestCase): del d self.assertEqual(len(v), 1) + def test_deepcopy_bound_method(self): + class Foo(object): + def m(self): + pass + f = Foo() + f.b = f.m + g = copy.deepcopy(f) + self.assertEqual(g.m, g.b) + self.assertTrue(g.b.im_self is g) + g.b() + def global_foo(x, y): return x+y |