[Pyrex] 0.9.5 'defaults' is it something special now?

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 30 00:25:06 UTC 2007


Helmut Jarausch wrote:
> the following code snippets worked just fine with Pyrex 0.9.4 but not
> with 0.9.5
> 
> In the .pyx file
> def Scanner(Line):
>   cdef NumTotal
>   ...
>   cdef defaults
>   
>   # set defaults
>   try :
>     NumTotal_D, NumSubs_D, NumIns_D, NumDels_D, IgnCase_D = Scanner.defaults
>     print "taking defaults"
>   except :
>     NumTotal_D, NumSubs_D, NumIns_D, NumDels_D, IgnCase_D = 1, 1, 0, 0, True
>   Mods= None
> .....
> 
> all of these cdef'ed variables are generated except the last one
> 'defaults'

The code you posted doesn't refer to the 'defaults' local. Can you
post the lines which are meant to assign or use it? Pyrex now avoids
generating declarations for local variables that aren't used, and it
might be failing for some reason to notice that 'defaults' is being
used.

> On the other hand, lateron, there is
>   __pyx_v_defaults = Py_None; Py_INCREF(Py_None);

If it really isn't being used, that line shouldn't get generated,
which is also a bug.

--
Greg



More information about the Pyrex mailing list