Opened http://trac.cython.org/cython_trac/ticket/207
On Fri, Feb 6, 2009 at 7:11 PM, Stefan Behnel <[email protected]> wrote: > Hi Lisandro, > > Lisandro Dalcin wrote: >> The only thing that I'm not completely sure about is the >> implementation of this, though it works fine in my 32bit Linux box >> >> static INLINE size_t __pyx_PyInt_AsSize_t(PyObject* b); > > I'd need to see the implementation to comment on this. > http://trac.cython.org/cython_trac/attachment/ticket/207/SIZE_T.diff#preview > >> Of course, this change is not backward compatible... Cython will not >> compile the code: >> >> cdef extern from "stdlib.h": >> ctypedef unsigned long size_t > > Is this because of an explicit error, or just a side effect of the > implementation? > Cython generates the following error (IMHO, that's a good thing) Error converting Pyrex file to C: ------------------------------------------------------------ ... #cython: embedsignature=True ctypedef unsigned long size_t ^ ------------------------------------------------------------ /u/dalcinl/Devel/mpi4py-dev/src/mpi4py.MPI.pyx:2:29: Empty declarator > >> What should be the behavior if the user tries to ctypedef 'Py_ssize_t' >> or 'size_t', provided that Cython treats them as pre-defined C types? > > I didn't care at the time when I implemented the Py_ssize_t stuff, but when > you ask now, I prefer getting at least a warning. I doubt that Cython > handles a "ctypedef ... int" gracefully, for example. > Sorry for the noise, I got confused.. Cython DO FAIL if you 'ctypedef ... Py_ssize_t'. > >> Finally, can I push the changes? > > Could you file a bug report for now (if only for documentation purposes) > and post the patch there? We should be a bit careful with major changes by > now, as we are currently trying to stabilise Cython for the 0.11 release. > OK. Just hope this can get in for the next release. > Thanks, > > Stefan > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
