Skip to content

Commit 88be79d

Browse files
committed
Use map_coefficients
1 parent 3dd953c commit 88be79d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/sage/rings/polynomial/multi_polynomial.pyx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,16 +871,23 @@ cdef class MPolynomial(CommutativePolynomial):
871871
872872
TESTS:
873873
874-
Check that :trac:`25022` is fixed::
874+
Check that :issue:`25022` is fixed::
875875
876876
sage: K.<x,y> = ZZ[]
877877
sage: (x*y).change_ring(SR).monomials() # needs sage.rings.number_field sage.symbolic
878878
[x*y]
879+
880+
Check that :issue:`36832` is fixed::
881+
882+
sage: F = GF(11)
883+
sage: phi = Hom(F,F).an_element()
884+
sage: R.<x,y> = F[]
885+
sage: x.change_ring(phi)
886+
x
879887
"""
880888
if isinstance(R, Map):
881-
#if we're given a hom of the base ring extend to a poly hom
882889
if R.domain() == self.base_ring():
883-
R = self.parent().hom(R, self.parent().change_ring(R.codomain()))
890+
return self.map_coefficients(R)
884891
return R(self)
885892
else:
886893
return self.parent().change_ring(R)(self.dict())

0 commit comments

Comments
 (0)