restriction on sum: intentional bug?

ryles rylesny at
Sat Oct 17 00:53:01 CEST 2009

On Oct 16, 11:39 am, Alan G Isaac < at> wrote:
> I expected this to be fixed in Python 3:
> >>> sum(['ab','cd'],'')
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
> TypeError: sum() can't sum strings [use ''.join(seq) instead]

Then you probably haven't read through these discussions:

sum and strings:
summing a bunch of numbers:

More information about the Python-list mailing list