[sage-devel] Re: Trying to extend Integer

2008-06-03 Thread Michel
> sage: m = matrix(ZZ,2,[1,2,3,4]) > sage: d = m.det(); d > -2 > sage: d.__init__(389) > sage: m > [1 2] > [3 4] > sage: m.det() > 389 This problem would not occur if m.det() were to return a copy of the cached determinant of m. Michel --~--~-~--~~~---~--~~

[sage-devel] Re: Trying to extend Integer

2008-06-02 Thread root
>sage: class foo: >... def __init__(self, a): >... self.b = a >sage: f = foo(10) >sage: f.b >10 >sage: f.__init__(20) >sage: f.b >20 > >Well Sage hasn't exploded already because of this, so >I guess we'll just have to live with it. Excellent. Now we can inflate integers to match t

[sage-devel] Re: Trying to extend Integer

2008-06-02 Thread William Stein
On Mon, Jun 2, 2008 at 10:30 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > On Jun 2, 2008, at 10:18 PM, William Stein wrote: > >> On Mon, Jun 2, 2008 at 10:15 PM, Robert Bradshaw >> <[EMAIL PROTECTED]> wrote: >>> >>> On Jun 2, 2008, at 9:51 PM, Igor Tolkov wrote: >>> I am trying to exten

[sage-devel] Re: Trying to extend Integer

2008-06-02 Thread Robert Bradshaw
On Jun 2, 2008, at 10:18 PM, William Stein wrote: > On Mon, Jun 2, 2008 at 10:15 PM, Robert Bradshaw > <[EMAIL PROTECTED]> wrote: >> >> On Jun 2, 2008, at 9:51 PM, Igor Tolkov wrote: >> >>> I am trying to extend the integer class: >>> >>> {{ >>> class Quple(Integer): >>> def __init__(self, a,

[sage-devel] Re: Trying to extend Integer

2008-06-02 Thread William Stein
On Mon, Jun 2, 2008 at 10:15 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > On Jun 2, 2008, at 9:51 PM, Igor Tolkov wrote: > >> I am trying to extend the integer class: >> >> {{ >> class Quple(Integer): >> def __init__(self, a, b): >> Integer.__init__(self, b) >> self.tup =

[sage-devel] Re: Trying to extend Integer

2008-06-02 Thread William Stein
On Mon, Jun 2, 2008 at 9:51 PM, Igor Tolkov <[EMAIL PROTECTED]> wrote: > > I am trying to extend the integer class: > > {{ > class Quple(Integer): >def __init__(self, a, b): >Integer.__init__(self, b) >self.tup = (a, b) > > print Quple(3,1) > /// > > 0 > }}} > > I should get "