Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for latest Cython master #177

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/flint/types/arb.pyx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from cpython.float cimport PyFloat_AS_DOUBLE
from cpython.version cimport PY_MAJOR_VERSION
from cpython.int cimport PyInt_AS_LONG
from cpython.long cimport PyLong_Check
from cpython.int cimport PyInt_Check

from flint.flint_base.flint_context cimport getprec
from flint.flint_base.flint_context cimport thectx
Expand Down Expand Up @@ -86,10 +83,6 @@ cdef int arb_set_python(arb_t x, obj, bint allow_conversion) except -1:
arb_set_fmpq(x, (<fmpq>obj).val, getprec())
return 1

if PY_MAJOR_VERSION < 3 and PyInt_Check(obj):
arb_set_si(x, PyInt_AS_LONG(obj))
return 1

if PyLong_Check(obj):
fmpz_init(t)
fmpz_set_pylong(t, obj)
Expand Down
6 changes: 0 additions & 6 deletions src/flint/types/fmpz.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from cpython.int cimport PyInt_Check, PyInt_AS_LONG
from cpython.long cimport PyLong_Check
from flint.flint_base.flint_base cimport flint_scalar
from flint.utils.conversion cimport chars_from_str
Expand All @@ -7,8 +6,6 @@ from flint.flintlib.flint cimport slong, pylong_as_slong
from flint.flintlib.flint cimport PyObject
from flint.flintlib.fmpz cimport fmpz_t, fmpz_set_str, fmpz_set_si

from cpython.version cimport PY_MAJOR_VERSION

cdef int fmpz_set_any_ref(fmpz_t x, obj)
cdef fmpz_get_intlong(fmpz_t x)

Expand All @@ -23,9 +20,6 @@ cdef inline int fmpz_set_pylong(fmpz_t x, obj):
fmpz_set_si(x, longval)

cdef inline int fmpz_set_python(fmpz_t x, obj):
if PY_MAJOR_VERSION < 3 and PyInt_Check(obj):
fmpz_set_si(x, PyInt_AS_LONG(obj))
return 1
if PyLong_Check(obj):
fmpz_set_pylong(x, obj)
return 1
Expand Down
2 changes: 0 additions & 2 deletions src/flint/types/fmpz_poly.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from cpython.int cimport PyInt_AS_LONG
from cpython.list cimport PyList_GET_SIZE
from cpython.long cimport PyLong_Check
from cpython.int cimport PyInt_Check

from flint.flint_base.flint_context cimport getprec
from flint.flint_base.flint_base cimport flint_poly
Expand Down
6 changes: 0 additions & 6 deletions src/flint/types/nmod_poly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ cdef class nmod_poly(flint_poly):
else:
raise TypeError("cannot set element of type %s" % type(x))

def degree(self):
return nmod_poly_degree(self.val)

def length(self):
return nmod_poly_length(self.val)

def __bool__(self):
return not nmod_poly_is_zero(self.val)

Expand Down
Loading