SF bug #910986: copy.copy fails for array.array

Added support for the copy module.
This commit is contained in:
Raymond Hettinger 2004-03-13 18:18:51 +00:00
parent 42bec93e5c
commit 3aa82c07f7
3 changed files with 24 additions and 0 deletions

View file

@ -73,6 +73,13 @@ class BaseTest(unittest.TestCase):
b.byteswap()
self.assertEqual(a, b)
def test_copy(self):
import copy
a = array.array(self.typecode, self.example)
b = copy.copy(a)
self.assertNotEqual(id(a), id(b))
self.assertEqual(a, b)
def test_insert(self):
a = array.array(self.typecode, self.example)
a.insert(0, self.example[0])