MinRK | 4 Jun 2012 00:18
Picon
Gravatar

__del__ never called?

Is the `__del__` method supposed to be totally ignored by Cython classes?


This case:

cdef class C(object):
    def __del__(self):
        print 'del'
    def __dealloc__(self):
        print 'dealloc'

When I do:

c = C()
del c

I just get 'dealloc'

The docs say that dealloc is the corollary for cinit, which I had interpreted as meaning that del still exists, just as init does.

Same behavior on 0.15.1 and 0.17pre

-MinRK
Czarek Tomczak | 20 May 2013 16:59
Picon
Gravatar

Re: __del__ never called?

From the documentation:


Note

 

There is no __del__() method for extension types.



Regards,
Czarek

On Monday, June 4, 2012 12:18:00 AM UTC+2, Min RK wrote:
Is the `__del__` method supposed to be totally ignored by Cython classes?

This case:

cdef class C(object):
    def __del__(self):
        print 'del'
    def __dealloc__(self):
        print 'dealloc'

When I do:

c = C()
del c

I just get 'dealloc'

The docs say that dealloc is the corollary for cinit, which I had interpreted as meaning that del still exists, just as init does.

Same behavior on 0.15.1 and 0.17pre

-MinRK

--
 
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane