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: sage-8.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:

Status badges

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 sage-support.

Change History (7)

comment:1 Changed 5 years ago by Vincent Delecroix

Branch: u/vdelecroix/25182
Commit: 76561b76936d22bade30163adfd8257e669d1c0f
Status: newneeds_review

New commits:

76561b7fix output type of degree method of polynomials

comment:2 Changed 5 years ago by John Cremona

Looks good to me. Positive review if the patchbots go green!

comment:3 Changed 5 years ago by git

Commit: 76561b76936d22bade30163adfd8257e669d1c0fc485d4cdf6da40aef58197303b259de16f721658

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

c485d4cdocfix

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

Reviewers: Frédéric Chapoton
Status: needs_reviewpositive_review

Let it be.

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

Reviewers: Frédéric ChapotonFrédéric Chapoton, John Cremona

comment:6 Changed 5 years ago by Vincent Delecroix

Merci :-)

comment:7 Changed 5 years ago by Volker Braun

Branch: u/vdelecroix/25182c485d4cdf6da40aef58197303b259de16f721658
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.