• Raymond Hettinger's avatar
    SF Patch 685051: fix for 680789: reprs in arraymodule · 88ba1e39
    Raymond Hettinger authored
    (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.
    88ba1e39
arraymodule.c 47.9 KB