[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-15 Thread Jason Grout
On 11/13/10 11:51 PM, William Stein wrote: Other comments: Jason Grout: If we're now making a convention for the global sum function (i.e., try calling the .sum() method first), I'm curious how many other objects have a .sum() method? Will this break things? If you type "sum??" and read yo

Re: [sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-14 Thread William Stein
On Sun, Nov 14, 2010 at 5:31 AM, Dima Pasechnik wrote: > > > On Nov 14, 1:51 pm, William Stein wrote: >> Hi, >> >> This thread is about sum. >> >> 1. Dima said: >> >> > I don't think sum() method is needed. It's certainly a code bloat. >> >> This is a very, very misinformed comment. I want to add

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-14 Thread Mathieu Guay-Paquet
On Nov 14, 1:51 am, William Stein wrote: > 1. Dima said: > > I don't think sum() method is needed. It's certainly a code bloat. > > Yes, the two methods accomplish the same thing. Actually, there is also a slight (but sometimes significant) functional difference between the two methods: sage: f

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-14 Thread Dima Pasechnik
On Nov 14, 1:51 pm, William Stein wrote: > Hi, > > This thread is about sum. > > 1. Dima said: > > > I don't think sum() method is needed. It's certainly a code bloat. > > This is a very, very misinformed comment. I want to address it, > especially the statement "It's certainly a code bloat."  

Re: [sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread William Stein
Hi, This thread is about sum. 1. Dima said: > I don't think sum() method is needed. It's certainly a code bloat. This is a very, very misinformed comment. I want to address it, especially the statement "It's certainly a code bloat." It is absolutely *NOT* code bloat to define a sum method for

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread Jason Grout
On 11/13/10 12:38 PM, Tom Boothby wrote: I agree, John. It would be better to define a .sum() method on the generic vector class, which calls the global sum(). Then, it'll be overridden by various classes which can do it faster. If we're now making a convention for the global sum function (i

Re: [sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread Tom Boothby
I agree, John. It would be better to define a .sum() method on the generic vector class, which calls the global sum(). Then, it'll be overridden by various classes which can do it faster. On Sat, Nov 13, 2010 at 6:15 AM, John Cremona wrote: > I'm not sure I agree with this.  I would expect the

Re: [sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread John Cremona
I'm not sure I agree with this. I would expect the global sum() to try to use a sum method first, and only do the default if that did not exist, since some classes might have better ways of summing themselves than the default. But then the only reason for having sum methods would be if there was

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread Dima Pasechnik
There could be code in other parts of devel/sage/sage that depends upon .sum(), althouh not too likely. You should run "make testlong" to see if anything breaks (well, it takes a while of course ) And then, you know, open a trac ticket with your patch. On Nov 13, 9:54 pm, Maxim wrote: > On 13 nov

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-13 Thread Maxim
On 13 nov, 00:18, Dima Pasechnik wrote: > I don't think sum() method is needed. It's certainly a code bloat. > Could you check that sum() in vector_double_dense can be removed? > (remove it there, do sage -b, run testsuite, see if there were any > errors caused by it) I just tried that, it worked

[sage-devel] Re: self.sum() method on vector made of int is not defined

2010-11-12 Thread Dima Pasechnik
I don't think sum() method is needed. It's certainly a code bloat. Could you check that sum() in vector_double_dense can be removed? (remove it there, do sage -b, run testsuite, see if there were any errors caused by it) On Nov 13, 12:59 pm, Maxim wrote: > If I try to find the sum of a vector of