[issue41740] string concatenation via `sum`

2020-09-07 Thread Marco Paolini
Marco Paolini added the comment: also worth noting, the start argument is type checked instead. Maybe we could apply the same checks to the items of the iterable? python3 -c "print(sum(('a', 'b', 'c'), start='d'))" Traceback (most recent call last): File "", line 1, in TypeError: sum()

[issue41740] string concatenation via `sum`

2020-09-07 Thread Marco Paolini
Marco Paolini added the comment: This happens because the default value for the start argument is zero , hence the first operation is `0 + 'a'` -- nosy: +mpaolini ___ Python tracker

[issue41740] string concatenation via `sum`

2020-09-07 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : I'm not sure whether this is a bug or a feature request, but it seems as though the following should produce the same result: In [1]: 'a' + 'b' + 'c' Out[1]: 'abc' In [2]: sum(('a', 'b', 'c')) TypeError Traceback (most recent call last) in > 1