#17741: Polynomial __div__ override redundant with coercion.
-------------------------+-------------------------------------------------
Reporter: | Owner:
robertwb | Status: needs_work
Type: | Milestone: sage-6.9
enhancement | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
coercion | Work issues:
Keywords: | Commit:
Authors: | f5a59a3400508531d6d19803dc277c01e896f8d8
Robert Bradshaw | Stopgaps:
Report Upstream: N/A |
Branch: |
public/17741 |
Dependencies: |
#17740 |
-------------------------+-------------------------------------------------
Changes (by vdelecroix):
* status: needs_review => needs_work
Comment:
I still get the error as in [comment:8]. Though the following works well
{{{
sage: (x+5) / R.base_ring()(2)
8*x + 10
}}}
and one can check
{{{
sage: cm = get_coercion_model()
sage: R.<x> = Integers(15)[]
sage: a = cm.get_action(R, R.base_ring(), operator.div)
sage: a(x+5,2)
8*x + 10
}}}
The problem is when we divide by an integer
{{{
sage: cm.get_action(R, ZZ, operator.div)
<NOTHING>
}}}
The above fails because the following does
{{{
sage: cm = get_coercion_model()
sage: R.<x> = Integers(15)[]
sage: right_mul = cm.get_action(R, ZZ, operator.mul)
sage: action = ~right_mul
Traceback (most recent call last):
...
CoercionException: x (=Ring of integers modulo 15) is not in Category of
integral domains
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/17741#comment:10>
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.