[issue7176] sum() doesn't work for lists.

2009-10-26 Thread Björn Augustsson
Björn Augustsson added the comment: On Tue, Oct 20, 2009 at 20:19, Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > One use of the start argument is used to specify an initial zero/metpy > value for the summation:  0  or  0.0   or Decimal(0)  or  [].

[issue7176] sum() doesn't work for lists.

2009-10-20 Thread Björn Augustsson
Björn Augustsson added the comment: Er, that's fairly weird... Couldn't it do eg "type(first argument)", and if it's a list, replace the 0 with []? What's the second argument's use anyway? s = sum([1,2,3,4]) + 3 seems a lot clearer than s = sum

[issue7176] sum() doesn't work for lists.

2009-10-20 Thread Björn Augustsson
New submission from Björn Augustsson : Summary: "sum()" doesn't work on lists, even though the docs says it should. The docs say: "Note that sum(range(n), m) is equivalent to reduce(operator.add, range(n), m)" That's not true.