sum and strings: Summary

Paul Rubin http
Fri Aug 18 22:47:07 EDT 2006


"Paddy" <paddy3118 at netscape.net> writes:
> I also found this from Guido:
>   http://mail.python.org/pipermail/python-dev/2003-April/034853.html
> And this, in the same thread:
>   http://mail.python.org/pipermail/python-dev/2003-April/034854.html
> 
> So,
> The upshot is that complexity matters. The algorithm used in sum is
> 'very wrong' for use with strings, and their is no clean way to switch
> to the preferred method for strings.( ''.join() ).

The clean fix is to use cStringIO to build the result string.



More information about the Python-list mailing list