You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-37611: Ensure degree and total degree return `Integer` type for `MPolynomial_polydict` class
This is a follow up PR to #37605
which ensures that `degree()` and `total_degree()` return a sage
`Integer` type instead of a python `int` for the `MPolynomial_polydict`
class.
However, `f.degrees()` returns something of type
`sage.rings.polynomial.polydict.ETuple` which has elements as `int`. I
am loathed to change this to return `Integer` in case of performance
regression, so the following status of `MPolynomial_polydict` is the
following:
```py
sage: R.<x, y> = PolynomialRing(QQbar)
sage: f = 1 + x + y^2
sage: type(f.degree())
<class 'sage.rings.integer.Integer'>
sage: type(f.degree(x))
<class 'sage.rings.integer.Integer'>
sage: type(f.degree(y))
<class 'sage.rings.integer.Integer'>
sage: type(f.total_degree())
<class 'sage.rings.integer.Integer'>
sage: type(f.degrees())
<class 'sage.rings.polynomial.polydict.ETuple'>
sage: type(f.degrees()[0])
<class 'int'>
```
I would like advice on how to proceed with the `degrees()` function. Is
leaving it in it's current state OK?
Fixes#37603
URL: #37611
Reported by: Giacomo Pope
Reviewer(s): Giacomo Pope, grhkm21
0 commit comments