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

Priority:  major  Milestone:  sage8.2 
Component:  algebra  Keywords:  
Cc:  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 4 years ago by
 Branch set to u/vdelecroix/25182
 Commit set to 76561b76936d22bade30163adfd8257e669d1c0f
 Status changed from new to needs_review
comment:2 Changed 4 years ago by
Looks good to me. Positive review if the patchbots go green!
comment:3 Changed 4 years ago by
 Commit changed from 76561b76936d22bade30163adfd8257e669d1c0f to c485d4cdf6da40aef58197303b259de16f721658
Branch pushed to git repo; I updated commit sha1. New commits:
c485d4c  docfix

comment:4 Changed 4 years ago by
 Reviewers set to Frédéric Chapoton
 Status changed from needs_review to positive_review
Let it be.
comment:5 Changed 4 years ago by
 Reviewers changed from Frédéric Chapoton to Frédéric Chapoton, John Cremona
comment:6 Changed 4 years ago by
Merci :)
comment:7 Changed 4 years ago by
 Branch changed from u/vdelecroix/25182 to c485d4cdf6da40aef58197303b259de16f721658
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
fix output type of degree method of polynomials