Josh wrote:
> One of the best features of python is its ease of use, and the ease of use
> of its modules. Modules like os, os.path, and datetime are invaluable!
>
> Does anyone know of analagous c++ libraries? It seems to me that most of the
> functionality of these modules could easily be repl
data)/len(data)
I thought that it would be very nice if the built-in sum() function used
this algorithm by default. Has this been brought up before? Would this
have any disadvantages (apart from a slight performance impact, but
Python is a high-level language anyway ...)?
Sza
Arnaud Delobelle wrote:
sum() works for any sequence of objects with an __add__ method, not
just floats! Your algorithm is specific to floats.
This occurred to me also, but then I tried
sum(['abc', 'efg'], '')
and it did not work. Or is this just a special exception to prevent the
misuse
Duncan Booth wrote:
Szabolcs Horvát <[EMAIL PROTECTED]> wrote:
I thought that it would be very nice if the built-in sum() function used
this algorithm by default. Has this been brought up before? Would this
have any disadvantages (apart from a slight performance impact, but
Pytho
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,
anyway. So I