sum(strings)

Terry Reedy tjreedy at udel.edu
Thu Jun 19 16:22:51 EDT 2003


"Paul Rubin" <http://phr.cx@NOSPAM.invalid> wrote in message
news:7xu1amvu8g.fsf at ruckus.brouhaha.com...
> Alex Martelli <aleax at aleax.it> writes:
> > No, if sum accepted a sequence of strings it WOULD
> > have to delegate to ''.join in that case -- and I just couldn't
> > find an elegant and totally general way to do that.
>
> Why can't it just check if all the values are strings, and delegate
if
> they are?

For one thing, *all* users would have to pay the checking time for
those who wanted to save three chars and write 'sum' instead
of"''.join".  As someone willing to do the latter, doesn't seem quite
worthwhile.

TJR






More information about the Python-list mailing list