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

2014年8月08日 17:56:29 -0700

On Aug 8, 2014, at 11:09 AM, Ethan Furman <[email protected]> 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).
Raymond
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to