On Fri, Oct 5, 2018 at 2:48 AM Miro HronĨok <mhroncok(a)redhat.com> wrote:
How can I help with the python3 transition?
I need some help after all. Cythonizing of src/sage/arith/long.pxd is
failing like so:
Error compiling Cython file:
------------------------------------------------------------
...
from cpython.object cimport Py_SIZE
from
cpython.int cimport PyInt_AS_LONG
from cpython.long cimport PyLong_AsLong
from cpython.number cimport PyNumber_Index, PyIndex_Check
from cpython.longintrepr cimport PyLongObject, PyLong_SHIFT, digit
^
------------------------------------------------------------
sage/arith/long.pxd:22:0: 'cpython/longintrepr/PyLongObject.pxd' not found
There is exactly one use of PyLongObject, on line 211:
cdef const digit* D = (<PyLongObject*>x).ob_digit
This code is translating between gmp mpz_t objects and python
integers. The error seems to be due to a change in cython, not in
python itself. Still, I'm not sure how to fix the code so that cython
will accept it.
This is from Includes/cpython/longintrepr.pxd in Cython 0.28.4, which
does not trigger the above error:
ctypedef struct PyLongObject:
digit* ob_digit
This is from the same file in Cython 0.29~rc2-1, which does trigger
the above error:
ctypedef class __builtin__.py_long [object PyLongObject]:
cdef digit* ob_digit
If one of you python experts out there could tell me how the sagemath
code needs to change to get access to x's ob_digit, I would appreciate
it very much. Thank you,
--
Jerry James
http://www.jamezone.org/