Trying to cythonizing this:

cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
        j += 1
    return j


I get this failure... Is this possible and easy to fix ?

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
                 ^
------------------------------------------------------------

/u/dalcinl/tmp/gil.pyx:3:18: Accessing Python global or builtin not
allowed without gil

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
                   ^
------------------------------------------------------------

/u/dalcinl/tmp/gil.pyx:3:20: Converting to Python object not allowed without gil

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
                 ^
------------------------------------------------------------

/u/dalcinl/tmp/gil.pyx:3:18: Constructing Python tuple not allowed without gil

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
                 ^
------------------------------------------------------------

/u/dalcinl/tmp/gil.pyx:3:18: Calling gil-requiring function without gil

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef int f() nogil:
    cdef int i,j=0, n=3
    for i in range(n):
            ^
------------------------------------------------------------

/u/dalcinl/tmp/gil.pyx:3:13: Iterating over Python object not allowed
without gil

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