Skip to content

Commit

Permalink
revert original fix -- replacing self._base(x) with self._base.coerce…
Browse files Browse the repository at this point in the history
…(x) -- from 12fc4bc
  • Loading branch information
mantepse committed Jul 27, 2024
1 parent 0b93f3a commit 3cdc7ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sage/rings/polynomial/infinite_polynomial_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,13 +889,15 @@ def _element_constructor_(self, x):
...
ValueError: cannot convert 1/3 into an element of Infinite polynomial ring in x over Integer Ring
Check that :issue:`37756` is fixed::
.. WARNING:
The :issue:`37756` is not yet fixed::
sage: L.<x, y> = QQ[]
sage: R.<a> = InfinitePolynomialRing(QQ)
sage: M = InfinitePolynomialRing(L, names=["a"])
sage: c = a[0]
sage: M(c)
sage: M(c) # known bug
a_0
"""
from sage.rings.polynomial.infinite_polynomial_element import InfinitePolynomial
Expand Down Expand Up @@ -931,7 +933,7 @@ def _element_constructor_(self, x):
if isinstance(self._base, MPolynomialRing_polydict):
x = sage_eval(repr(), next(self.gens_dict()))
else:
x = self._base.coerce(x)
x = self._base(x)
# remark: Conversion to self._P (if applicable)
# is done in InfinitePolynomial()
return InfinitePolynomial(self, x)
Expand Down

0 comments on commit 3cdc7ad

Please sign in to comment.