[Python-checkins] python/dist/src/Lib/test test_array.py,1.27,1.28
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Sun Mar 14 00:44:01 EST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17368/Lib/test
Modified Files:
test_array.py
Log Message:
SF feature request #686323: Minor array module enhancements
array.extend() now accepts iterable arguments implements as a series
of appends. Besides being a user convenience and matching the behavior
for lists, this the saves memory and cycles that would be used to
create a temporary array object.
Index: test_array.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_array.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** test_array.py 13 Mar 2004 18:18:51 -0000 1.27
--- test_array.py 14 Mar 2004 05:43:58 -0000 1.28
***************
*** 593,596 ****
--- 593,603 ----
self.assertRaises(TypeError, a.extend, b)
+ a = array.array(self.typecode, self.example)
+ a.extend(self.example[::-1])
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example+self.example[::-1])
+ )
+
def test_coveritertraverse(self):
try:
More information about the Python-checkins
mailing list