On Sep 13, 9:27 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Note that, despite appearances, it's not as built-in as one might
> wish.  sum(seq) is still completely generic and works on all
> number-like objects (in fact on all objects that define an __add__
> operation except strings, which are explicitly forbidden).  This means
> that it can't just go ahead and execute a C addition, it must properly
> call PyNumber_Add (the C API call equivalent to Python's "+"
> operator), which will then inspect the objects and invoke the
> appropriate implementation of addition.

The time machine strikes again!  Try using Py2.6.
The built-in sum() function is much smarter and faster.
It does in fact use C addition.


Raymond
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to