[Cython] range optimization and noqil

Lisandro Dalcin dalcinl at gmail.com
Wed Feb 4 15:06:28 CET 2009


Yes, I changed my code to use for-loops.

But I still think that the refnanny should not be emmited for 'pure'
functions. Declaring them as nogil does the trick, but this can cause
other sorce code changed. For example, in Cython/Include, you have a
pxd with C stdlib stuff. These declarations do not have the 'nogil',
then you cannot use them inside other 'nogil' functions.

I'll try to work on this in the near future...


On Wed, Feb 4, 2009 at 7:49 AM, Dag Sverre Seljebotn
<dagss at student.matnat.uio.no> wrote:
> Lisandro Dalcin wrote:
>> 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 ?
>>
>
> Thanks, good point. This is now
>
> http://trac.cython.org/cython_trac/ticket/205
>
> I think it is definitely 0.12 stuff, so use a for-from construct if you
> need this for 0.11.
>
> If you just want to run the refnanny, perhaps consider just disabling
> the line in the source raising the error on your local copy?
>
> Dag Sverre
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> 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


More information about the Cython-dev mailing list