On Fri, Nov 09, 2012 at 05:58:48AM +0000, Simon King wrote: > On 2012-11-09, Robert Bradshaw <rober...@math.washington.edu> wrote: > > __len__ must return a (machine-sized) int, not elements of ZZ let > > alone infinity. > > Sorry, I didn't know that. Then one should probably go the other way, > implement cardinality() for more parents, and use it in "sum".
Oops, Robert had already answered :-) I object to using cardinality in sum. For many parents, cardinality is implemented by iterating through the elements (for there is nothing better), and we don't want it do that twice (the point of V.sum is *speed*). In any cases, V.sum(...) should quite rarely be called on a parent (it only makes sense if that parent is a subset of V), so I would not bother about it. On the other hand V.sum could bark if it gets objects that are not in V, and its documentation could certainly use some love. 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.