]> granicus.if.org Git - python/commit
SF Patch 685051: fix for 680789: reprs in arraymodule
authorRaymond Hettinger <python@rcn.com>
Wed, 23 Apr 2003 17:27:00 +0000 (17:27 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 23 Apr 2003 17:27:00 +0000 (17:27 +0000)
commit88ba1e39ecf32d0a2328358351fff3006a5b30b9
tree62ec435a8f72c680b192c3e95991e7fb602d6703
parent444e434011408d474cbd167c2276ad51259eda20
SF Patch 685051:  fix for 680789: reprs in arraymodule
(contributed by logistix; substantially reworked by rhettinger).

To create a representation of non-string arrays, array_repr() was
starting with a base Python string object and repeatedly using +=
to concatenate the representation of individual objects.

Logistix had the idea to convert to an intermediate tuple form and
then join it all at once.  I took advantage of existing tools and
formed a list with array_tolist() and got its representation through
PyObject_Repr(v) which already has a fast implementation for lists.
Modules/arraymodule.c