summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-04 11:02:04 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-04 11:02:04 (GMT)
commitc29cc6a8f27bcbe74772b691a352c8e299a6abfa (patch)
tree84da71c8ac60efa3d5a9391fcd73dafc27e1a5c5 /Lib/test/test_array.py
parent9d8711964f114b9f0f5ed8a9a1eccfba2a096030 (diff)
downloadcpython-c29cc6a8f27bcbe74772b691a352c8e299a6abfa.zip
cpython-c29cc6a8f27bcbe74772b691a352c8e299a6abfa.tar.gz
cpython-c29cc6a8f27bcbe74772b691a352c8e299a6abfa.tar.bz2
#1569291: speed up array.repeat() by making only O(log n) memcpy() calls; the code follows unicode_repeat.
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 1cce991..b44eb97 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -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):