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/034834.html below:

summing a bunch of numbers (or "whatevers")

[Python-Dev] Fwd: summing a bunch of numbers (or "whatevers")Aahz aahz@pythoncraft.com
Sun, 20 Apr 2003 22:51:54 -0400
On Sun, Apr 20, 2003, Barry Warsaw wrote:
> On Sun, 2003-04-20 at 20:58, Guido van Rossum wrote:
>> 
>> (A minority view that I can't quite shake off: since the name sum()
>> strongly suggests it's summing up numbers, sum([]) should be 0 and no
>> second argument is allowed.  I find using sum() for a sequence of
>> strings a bit weird anyway, and will probably continue to write
>> "".join(S) for that case.)
> 
> I agree.  I'd rather see sum() constrain itself to numbers and sum([])
> == 0.  Then I don't see a need for second argument.  "Summing" a list of
> strings doesn't make much sense to me.

Problem is, what *kind* of number?  While ints are in general easily
promotable (especially int 0), I'd prefer to make things explicit.
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?



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