Dag Sverre Seljebotn wrote: > Lisandro Dalcin wrote: >> Well, what I do not like about your patch is that the cdef module >> globals are not initialized to 'None' in the module init function. And >> this is a bit unsafe, Cython almost always assumes that PyObect* >> pointers are not-NULL. I can imagine some code breaking with your >> patch. >> > > Indeed, it is unsafe. Very much so, I just created a crashing testcase :-)
OK, my last attempt is up as a new patch on the ticket: <http://trac.cython.org/cython_trac/ticket/90> It works in this way: Assignment nodes which are created from cdef statements in the module scope doesn't get the "first" attribute set to True (as it is not guaranteed that the cdef statement is indeed the first assignment, indeed they are implicitly always set to None first). I now realize what made my worry about your patch: It works ok, but it corrects something which was set wrongly in the first place. This should fix the root cause instead. -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
