[issue41740] string concatenation via `sum`
Phillip M. Feldman
report at bugs.python.org
Mon Sep 7 15:21:29 EDT 2020
New submission from Phillip M. Feldman <Phillip.M.Feldman at gmail.com>:
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 sum(('a', 'b', 'c'))
TypeError: unsupported operand type(s) for +: 'int' and 'str'
The error message is confusing (there is no integer).
----------
components: Interpreter Core
messages: 376526
nosy: Phillip.M.Feldman at gmail.com
priority: normal
severity: normal
status: open
title: string concatenation via `sum`
type: behavior
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41740>
_______________________________________
More information about the Python-bugs-list
mailing list