On Fri, Nov 09, 2012 at 08:44:15AM -0800, Nils Bruin wrote:
> Yes, this is odd. python's sum really does start with adding zero,
> even if no initial value is given.

This indeed looks like a natural spot for optimization. However it
would change the semantic:

    sage: sum([1,2], 0.0)
    3.00000000000000

Besides, sum would need to know whether ``start`` is a neutral
element before doing the optimization.

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to