Egh, yep you guys are right again.  In this case the only thing I can think
of is to just forego the --Py_REFCNT(o) line altogether, which should work,
and shouldn't affect the execution of the program at all.  (That is...
unless tp_free checks the refcount, which may be...)

Even if it wouldn't affect anything, it still would make me feel a bit
dirty...

On May 13, 2010 1:05 AM, "Dag Sverre Seljebotn" <[email protected]>
wrote:

Dan Roberts wrote:
>
> Thanks for the reply. Of course you're right, Py_DECREF() might cause
> inf...
If this is what I'm thinking it is:

def printsomething(x):
   y = x # incref from 0 to 1
   print y
   # here, decref y => infinite recursion

cdef class A:
   cdef __dealloc__(self):
       # refcount of self is 0 (without workaround)
       printsomething(self)

Dag Sverre


> Thanks,
> Dan
>
>> On May 12, 2010 8:25 PM, "Robert Bradshaw"
>> <[email protected] <mailto:[email protected]>>

>> wrote:
>>
>> On May 12, 2010, at 5:44 PM, Dan Roberts wrote:
>> > While we're talking about this ...
>> <mailto:[email protected]>>

>> >> wrote:
>> >> >
>> >> > ...
>>
>> > _______________________________________________
>> > Cython...
> ------------------------------------------------------------------------
>
> _______________________________________________
> Cython-dev mailing list

> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>

________________...
Cython-dev mailing list

[email protected]
http://codespeak.net/mailman/listinfo/cython-dev
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to