[Python-Dev] sum(...) limitation

Alexander Belopolsky alexander.belopolsky at gmail.com
Sat Aug 2 16:52:07 CEST 2014


On Sat, Aug 2, 2014 at 3:39 AM, Steven D'Aprano <steve at pearwood.info> wrote:

> String concatenation with + is an attractive
> nuisance for many people, including some who actually know better but
> nevertheless do it. Also, for reasons I don't understand, many people
> dislike or cannot remember to use ''.join.
>

Since sum() already treats strings as a special case, why can't it simply
call (an equivalent of) ''.join itself instead of telling the user to do
it?  It does not matter why "many people dislike or cannot remember to use
''.join" - if this is a fact - it should be considered by language
implementors.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140802/71342afb/attachment.html>


More information about the Python-Dev mailing list