Feature suggestion: sum() ought to use a compensated summationalgorithm

Duncan Booth duncan.booth at invalid.invalid
Fri May 9 12:59:58 EDT 2008


"Terry Reedy" <tjreedy at udel.edu> wrote:

> 
> "Szabolcs Horvát" <szhorvat at gmail.com> wrote in message 
> news:fvmdg1$1e4p$1 at toralf.uib.no...
>| Gabriel Genellina wrote:
>| >
>| > Python doesn't require __add__ to be associative, so this should
>| > not be 
> used as a general sum replacement.
>|
>| It does not _require_ this, but using an __add__ that is not
>| commutative and associative, or has side effects, would qualify as a
>| serious misuse, 
> 
> seq + seq is not commutative ;-) 
> 
And three days ago Szabolcs already posted a followup to that 
comment saying: "Sorry, I meant associative only, not commutative.".



More information about the Python-list mailing list