Hi David and John,

On 2012-11-08, David Loeffler <d.a.loeff...@warwick.ac.uk> wrote:
> It is *really awful* that V.sum(W) attempts to sum all the elements of
> W! I don't know what general design decision underlies this but I
> don't like it.

That's easy to explain. All additive semigroups should be able to sum up a
list of their elements. Hence, such as summation method is defined by
the category framework.

Apparently it not only accepts a list, but any iterable.
Problem: Vektor spaces may be infinite, but are iterable.

Solution: The sum() method (and prod() similarly) should accept
iterables *of finite length*. Hence if you have a vector space V
and len(V) raises an error (this is what it currently does) or
returns Infinity, then V.sum(V) should raise an error.

Other solution: Rename sum() to sum_of_elements(). I don't like it.

Cheers,
Simon


-- 
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