[Python-Dev] sum(...) limitation

Ethan Furman ethan at stoneleaf.us
Fri Aug 8 20:09:45 CEST 2014


On 08/08/2014 08:23 AM, Chris Barker wrote:
>
> So my final question is this:
>
> repeated string concatenation is not the "recommended" way to do this -- but nevertheless, cPython has an optimization
> that makes it fast and efficient, to the point that there is no practical performance reason to prefer appending to a
> list and calling join()) afterward.
>
> So why not apply a similar optimization to sum() for strings?

That I cannot answer -- I find the current situation with sum highly irritating.

--
~Ethan~


More information about the Python-Dev mailing list