#19628: Fix interplay between lazy_import, coercion and arb
-------------------------------------+-------------------------------------
Reporter: cheuberg | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.10
Component: numerical | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: u/cheuberg/19152 | Commit:
-arb-misc-lazy-import | b21aa6e069182b08aca3cf7c24d6ed24e5926510
Dependencies: #19152 | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by jdemeyer:
Old description:
> In #19152, a `lazy_import` of `RBF` and `RealBallField` led to the error
> {{{
> File "src/sage/rings/real_arb.pyx", line 314, in
> sage.rings.real_arb.RealBallField
> Failed example:
> (1/2*RBF(1)) + AA(sqrt(2)) - 1 + polygen(QQ, x)
> Exception raised:
> Traceback (most recent call last):
> ...
> TypeError: unsupported operand parent(s) for '+': 'Real ball field
> with 53 bits precision' and 'Univariate Polynomial Ring in x over
> Rational Field'
> }}}
New description:
In #19152, a `lazy_import` of `RBF` and `RealBallField` led to the error
{{{
sage: polygen(RBF, x)
x
sage: RBF(1) + polygen(QQ, x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-2-2c3da6ca2a95> in <module>()
----> 1 RBF(Integer(1)) + polygen(QQ, x)
/usr/local/src/sage-git/src/sage/structure/element.pyx in
sage.structure.element.RingElement.__add__
(build/cythonized/sage/structure/element.c:15967)()
1649 elif PyInt_CheckExact(left):
1650 return
(<RingElement>right)._add_long(PyInt_AS_LONG(left))
-> 1651 return coercion_model.bin_op(left, right, add)
1652
1653 cdef RingElement _add_long(self, long n):
/usr/local/src/sage-git/src/sage/structure/coerce.pyx in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(build/cythonized/sage/structure/coerce.c:9835)()
1067 # We should really include the underlying error.
1068 # This causes so much headache.
-> 1069 raise TypeError(arith_error_message(x,y,op))
1070
1071 cpdef canonical_coercion(self, x, y):
TypeError: unsupported operand parent(s) for '+': 'Real ball field with 53
bits precision' and 'Univariate Polynomial Ring in x over Rational Field'
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/19628#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.