#1569291: speed up array.repeat() by making only O(log n) memcpy() calls; the code follows unicode_repeat.

This commit is contained in:
Georg Brandl 2010-12-04 11:02:04 +00:00
parent 9d8711964f
commit c29cc6a8f2
3 changed files with 25 additions and 9 deletions

View file

@ -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):