On Mon, 04 Dec 2006 05:37:02 -0800, Luislang <[EMAIL PROTECTED]> wrote:

>
>
>
> sage: a=pari('a')
> sage: a+1
>  _4 = a + 1
> sage: 1+a
> ------------------------------------------------------------
> Traceback (most recent call last):
>   File "<console>", line 1, in ?
>   File "integer.pyx", line 471, in integer.Integer.__add__
>   File "coerce.pyx", line 123, in coerce.bin_op
> TypeError: unable to find a common parent for 1 (parent: Integer Ring)
> and a (parent: Interface to the PARI C library)

Thanks for the bug report.  This is because in SAGE-1.5, I evidently forgot
to transition the PARI interface to the new arithmetic model (in  
libs/pari/gen.pyx):

     def __add__(self, other):
         if isinstance(self, gen) and isinstance(other, gen):
             return self._add(other)
         return sage.structure.coerce.bin_op(self, other, operator.add)

but it should be _add_c_impl, etc.  Thanks.

By the way, in the future a+1 and 1+a will both be defined and be
elements of "the PARI C library ring", since there is a canonical map
 from Z to PARI.

This currently works currently for the GP interface:

sage: a=gp('a')
sage: 1+a
a + 1
sage: a+1
a + 1
sage: parent(a+1)
GP/PARI interpreter


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to