[Python-Dev] sum(...) limitation
raymond.hettinger at gmail.com
Sat Aug 9 02:34:34 CEST 2014
On Aug 8, 2014, at 11:09 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
>> So why not apply a similar optimization to sum() for strings?
> That I cannot answer -- I find the current situation with sum highly irritating.
It is only irritating if you are misusing sum().
The str.__add__ optimization was put in because
it was common for people to accidentally incur
the performance penalty.
With sum(), we don't seem to have that problem
(I don't see people using it to add lists except
just to show that could be done).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev