sum and strings
Paul Rubin
http
Fri Aug 18 21:58:00 EDT 2006
Georg Brandl <g.brandl-nospam at gmx.net> writes:
> Why would you try to sum up strings? Besides, the ''.join idiom is quite
> common in Python.
Just because it's common doesn't mean it's obvious. In my opinion
it's as ugly as sin, and the fact that it's an idiom shows a
shortcoming in Python. The obvious reason for summing strings is that
it's a long-established feature of Python that a+b concatenates two
strings, so summing a,b,c,d,e should result in a+b+c+d+e.
More information about the Python-list
mailing list