mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
This commit is contained in:
parent
42bec93e5c
commit
3aa82c07f7
3 changed files with 24 additions and 0 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue