[sage-devel] Re: bug in RIng

2008-07-15 Thread David Joyner
Done. It's 3655. On Mon, Jul 14, 2008 at 9:38 PM, mabshoff <[EMAIL PROTECTED]> wrote: > > > > On Jul 14, 6:34 pm, "David Joyner" <[EMAIL PROTECTED]> wrote: >> Wow, thanks! I'll make up a patch right now. > > I am not so sure this is the proper fix, but you ought to open a > ticket for the issue a

[sage-devel] Re: bug in RIng

2008-07-14 Thread mabshoff
On Jul 14, 6:34 pm, "David Joyner" <[EMAIL PROTECTED]> wrote: > Wow, thanks! I'll make up a patch right now. I am not so sure this is the proper fix, but you ought to open a ticket for the issue anyway. Thanks, Michael --~--~-~--~~~---~--~~ To post to this gr

[sage-devel] Re: bug in RIng

2008-07-14 Thread David Joyner
Wow, thanks! I'll make up a patch right now. On Mon, Jul 14, 2008 at 3:25 PM, cgb <[EMAIL PROTECTED]> wrote: > > I think the solution is just to define __rmul__ : > > sage: x = PolynomialRing(QQ,'x').gen() > sage: f = Piecewise([[(0,1),1*x^0]]) > sage: r = f*2 > sage: r = 2*f > -

[sage-devel] Re: bug in RIng

2008-07-14 Thread cgb
I think the solution is just to define __rmul__ : sage: x = PolynomialRing(QQ,'x').gen() sage: f = Piecewise([[(0,1),1*x^0]]) sage: r = f*2 sage: r = 2*f --- TypeError Traceback (most recent ca

[sage-devel] Re: bug in RIng

2008-07-12 Thread David Joyner
Possibly, this is not a bug in Ring. For the class of Piecewise functions, __mul__ is implemented in a way that allows you to multiply two elements in that class. If you try to multiply a piecewise times a rational (in that order) then it detects this and creats on the fly a piecewise function equ