diff Lib/test/test_array.py @ 39653:a88bc3bad651 legacy-trunk

Fix SF bug #1545837: array.array borks on deepcopy. array.__deepcopy__() needs to take an argument, even if it doesn't actually use it. Will backport to 2.5 and 2.4 (if applicable.)
author Thomas Wouters <thomas@python.org>
date Thu, 24 Aug 2006 18:40:20 +0000
parents 0bc3f74a4a47
children 77e0f4718a7c
line wrap: on
line diff
--- a/Lib/test/test_array.py	Wed Aug 23 22:17:59 2006 +0000
+++ b/Lib/test/test_array.py	Thu Aug 24 18:40:20 2006 +0000
@@ -85,6 +85,13 @@
         self.assertNotEqual(id(a), id(b))
         self.assertEqual(a, b)
 
+    def test_deepcopy(self):
+        import copy
+        a = array.array(self.typecode, self.example)
+        b = copy.deepcopy(a)
+        self.assertNotEqual(id(a), id(b))
+        self.assertEqual(a, b)
+
     def test_pickle(self):
         for protocol in (0, 1, 2):
             a = array.array(self.typecode, self.example)