summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_copy.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-28 15:58:27 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-28 15:58:27 (GMT)
commit1fc0d2b364b144e501615cf82e998beb87733607 (patch)
treec1c1c81def7ee308624314b0367b9845d969e0a0 /Lib/test/test_copy.py
parent38478d8654115de4f3d1964b59f892deebbdb728 (diff)
downloadcpython-1fc0d2b364b144e501615cf82e998beb87733607.zip
cpython-1fc0d2b364b144e501615cf82e998beb87733607.tar.gz
cpython-1fc0d2b364b144e501615cf82e998beb87733607.tar.bz2
Merged revisions 76571 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76571 | antoine.pitrou | 2009-11-28 16:55:58 +0100 (sam., 28 nov. 2009) | 3 lines Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins. ........
Diffstat (limited to 'Lib/test/test_copy.py')
-rw-r--r--Lib/test/test_copy.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index 2af2109..2df0deb 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -677,6 +677,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.__self__ is g)
+ g.b()
+
def global_foo(x, y): return x+y