[Python-Dev] Re: Fwd: summing a bunch of numbers (or "whatevers")

Terry Reedy tjreedy@udel.edu
Mon, 21 Apr 2003 15:01:32 -0400

"Guido van Rossum" <guido@python.org> wrote in message
> sum(sequence_of_strings) is out.  *If* "".join() is really too ugly
> still think it's a matter of getting used to, like indentation), we
> could add join(seq, delim) as a built-in.  VB has one. :-)

Given that we already have the 'less ugly' alternative str.join(delim,
both sum(strseq) and a hypothetical builtin seem unnecessary.  And, an
explicit udelim.join(sseq) or unicode.join(udelim, sseq) nicely
handles mixed seqs without type guessing.

>>> str.join('', ['a','b','c']
>>> unicode.join(u'', ['a',u'b'])

Terry J. Reedy