Phillip M. Feldman <phillip.m.feld...@gmail.com> added the comment:

I'd forgotten about ''.join; this is a good solution.  I withdraw my
comment.

On Mon, Sep 7, 2020 at 3:25 PM Steven D'Aprano <rep...@bugs.python.org>
wrote:

>
> Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
>
> Marco, sum should be as fast as possible, so we don't want to type check
> every single element. But if it is easy enough, it might be worth checking
> the first element, and if it fails, report:
>
>     cannot add 'type' to start value
>
> where 'type' is the type of the first element. If that is str, then
> concatenate
>
>     (use ''.join(iterable) instead)
>
> to the error message.
>
> ----------
>
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <https://bugs.python.org/issue41740>
> _______________________________________
>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41740>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to