#19459: Fix containment
-------------------------------------+-------------------------------------
Reporter: switzel | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.10
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: Stefan Witzel | Reviewers: Peter Bruin
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/switzel/fix_containment | 299fbb32269c30f61f1814e70806b28de1a0e57a
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by switzel:
Old description:
> Containment testing catches TypeError, ValueError, ZeroDivisionError.
> However, casting a Laurent series to a power series (when it isn't one)
> raises an ArithmeticError. This commit adds ArithmeticError to the list
> to make the following code work:
>
> {{{
> L.<t> = LaurentSeriesRing(GF(2))
> R.<x,y> = PolynomialRing(L)
> O = L.power_series_ring()
> S.<x,y> = PolynomialRing(O)
> t**(-1)*x*y in S
> }}}
New description:
Containment testing catches `TypeError`, `ValueError`,
`ZeroDivisionError`.
However, casting a Laurent series to a power series (when it isn't one)
raises an `ArithmeticError`. This fix makes the cast throw a `TypeError`
rather than an `ArithmeticError` to make the following code work:
{{{
L.<t> = LaurentSeriesRing(GF(2))
R.<x,y> = PolynomialRing(L)
O = L.power_series_ring()
S.<x,y> = PolynomialRing(O)
t**(-1)*x*y in S
}}}
--
--
Ticket URL: <http://trac.sagemath.org/ticket/19459#comment:11>
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.