A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-April/034863.html below:

summing a bunch of numbers (or "whatevers")

[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
news:200304211248.h3LCmw622763@pcp02138704pcs.reston01.va.comcast.net.
..
> sum(sequence_of_strings) is out.  *If* "".join() is really too ugly
(I
> 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,
strseq),
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']
'abc'
>>> unicode.join(u'', ['a',u'b'])
u'ab'

Terry J. Reedy






RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4