New submission from Phillip M. Feldman <[email protected]>:
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: [email protected]
priority: normal
severity: normal
status: open
title: string concatenation via `sum`
type: behavior
versions: Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41740>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com