Opened 5 years ago
Closed 5 years ago
#25182 closed defect (fixed)
coherent output type for polynomial.degree()
Reported by:  Vincent Delecroix  Owned by:  

Priority:  major  Milestone:  sage8.2 
Component:  algebra  Keywords:  
Cc:  John Cremona  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Frédéric Chapoton, John Cremona 
Report Upstream:  N/A  Work issues:  
Branch:  c485d4c (Commits, GitHub, GitLab)  Commit:  c485d4cdf6da40aef58197303b259de16f721658 
Dependencies:  Stopgaps: 
Description
Some methods expect a Sage integer from the degree method but this is not consistent accross sage polynomials
sage: R1 = PolynomialRing(Zmod(3), 'x', implementation='NTL') sage: type(R1.an_element().degree()) <type 'int'> sage: R2 = PolynomialRing(Zmod(3), 'x', implementation='FLINT') sage: type(R2.an_element().degree()) <type 'sage.rings.integer.Integer'>
As a consequence
sage: GF(next_prime(2^63)^6) Traceback (most recent call last): ... AttributeError: 'int' object has no attribute 'divisors'
Initial report on sagesupport.
Change History (7)
comment:1 Changed 5 years ago by
Branch:  → u/vdelecroix/25182 

Commit:  → 76561b76936d22bade30163adfd8257e669d1c0f 
Status:  new → needs_review 
comment:3 Changed 5 years ago by
Commit:  76561b76936d22bade30163adfd8257e669d1c0f → c485d4cdf6da40aef58197303b259de16f721658 

Branch pushed to git repo; I updated commit sha1. New commits:
c485d4c  docfix

comment:4 Changed 5 years ago by
Reviewers:  → Frédéric Chapoton 

Status:  needs_review → positive_review 
Let it be.
comment:5 Changed 5 years ago by
Reviewers:  Frédéric Chapoton → Frédéric Chapoton, John Cremona 

comment:7 Changed 5 years ago by
Branch:  u/vdelecroix/25182 → c485d4cdf6da40aef58197303b259de16f721658 

Resolution:  → fixed 
Status:  positive_review → closed 
Note: See
TracTickets for help on using
tickets.
New commits:
fix output type of degree method of polynomials