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 [].
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
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.