On Fri, Oct 9, 2009 at 3:52 AM, Robert Bradshaw
<[email protected]> wrote:
>
> Well, if we have size_t, we should probably support ssize_t as well.
>

Would this do the trick ? Or do you want to use the "true" ssize_t,
even in older Python's ??

cdef extern from *:
    ctypedef int ssize_t "Py_ssize_t"

The Py<->C conversion should not used the Index C-API calls, and
should be platform-agnostic (because of my patch for extern ctypedef
integrals).. Take a look at the code generated from the snippet below:

cdef extern from *:
    ctypedef int ssize_t "Py_ssize_t"

def test_ssize_t(a, b, c):
    """
    >>> test_ssize_t(4.0, 3, -2)
    (4, 3, -2)
    """
    cdef ssize_t x  = a
    cdef ssize_t y  = b
    cdef ssize_t z  = c
    return (x, y, z)

>
> http://trac.cython.org/cython_trac/ticket/399
>

So we really need it? I think now it is not essential... But I would
like to have it anyway, just for symmetry with size_t ...

What do you thing about aliasing the Cython-level ssize_t to the
C-level Py_ssize_t?

> - Robert
>
>
> _______________________________________________
> 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

Reply via email to