mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#1569291: speed up array.repeat() by making only O(log n) memcpy() calls; the code follows unicode_repeat.
This commit is contained in:
parent
9d8711964f
commit
c29cc6a8f2
3 changed files with 25 additions and 9 deletions
|
@ -504,6 +504,12 @@ class BaseTest(unittest.TestCase):
|
|||
array.array(self.typecode)
|
||||
)
|
||||
|
||||
a = 5 * array.array(self.typecode, self.example[:1])
|
||||
self.assertEqual(
|
||||
a,
|
||||
array.array(self.typecode, [a[0]] * 5)
|
||||
)
|
||||
|
||||
self.assertRaises(TypeError, a.__mul__, "bad")
|
||||
|
||||
def test_imul(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue