
Aug. 9, 2014
12:34 a.m.
On Aug 8, 2014, at 11:09 AM, Ethan Furman <ethan@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). Raymond