Opened 3 years ago

Closed 3 years ago

#25182 closed defect (fixed)

coherent output type for polynomial.degree()

Reported by: vdelecroix Owned by:
Priority: major Milestone: sage-8.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:

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 3 years ago by vdelecroix

  • Branch set to u/vdelecroix/25182
  • Commit set to 76561b76936d22bade30163adfd8257e669d1c0f
  • Status changed from new to needs_review

New commits:

76561b7fix output type of degree method of polynomials

comment:2 Changed 3 years ago by cremona

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

comment:3 Changed 3 years ago by git

  • Commit changed from 76561b76936d22bade30163adfd8257e669d1c0f to c485d4cdf6da40aef58197303b259de16f721658

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

c485d4cdocfix

comment:4 Changed 3 years ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

Let it be.

comment:5 Changed 3 years ago by chapoton

  • Reviewers changed from Frédéric Chapoton to Frédéric Chapoton, John Cremona

comment:6 Changed 3 years ago by vdelecroix

Merci :-)

comment:7 Changed 3 years ago by vbraun

  • 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.