sum and strings

Fredrik Lundh fredrik at pythonware.com
Thu Aug 24 13:12:17 EDT 2006


Gabriel Genellina wrote:

> sequences don't have to be homogeneous, and iterators cant go back.
> But let GvR say that in his own words: 
> http://mail.python.org/pipermail/python-dev/2003-April/034854.html

you could of course dispatch on the type of the second argument (the 
start value), but that'd be at least as silly.  here's the relevant 
pronouncement:

   http://mail.python.org/pipermail/python-dev/2003-April/034853.html

and here's an elaboration by the martellibot:

   http://mail.python.org/pipermail/python-dev/2003-April/034855.html

(and note that the python-dev consensus is that sum is for numbers and 
join is for strings.  anyone who cares about writing readable code knows 
that names matter; different things should have different names.)

(I still think a "join" built-in would be nice, though.  but anyone who 
argues that "join" should support numbers too will be whacked with a 
great big halibut.)

</F>




More information about the Python-list mailing list