Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-36127: Bandaid for polynomial evaluation
There was a problem when evaluating polynomials: the following was failing ``` sage: x,y=polygens(QQ,'x,y') sage: t=PolynomialRing(x.parent(),'t').gen() sage: F=x*y*t sage: F(x=1) y*t ``` I propose a fix that hopefully does not break anything else. We look at a non-zero coefficient to try to guess the correct new base ring, instead of looking at the constant term. This does not fix the following inconsistent behaviour: ``` sage: x.parent().zero()(x=1) 0 sage: parent(_) Rational Field sage: x.parent().one()(x=1) 1 sage: parent(_) Multivariate Polynomial Ring in x, y over Rational Field ``` ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. URL: #36127 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Marc Mezzarobba
- Loading branch information