On Sep 29, 11:16 am, sturlamolden <sturlamol...@yahoo.no> wrote: > On 29 Sep, 19:11, Carl Banks <pavlovevide...@gmail.com> wrote: > > > CObjects can be passed a C function as a deallocator; this should work > > as reliably as a custom class deallocator. > > Except that __del__ prevents cyclic GC.
You are mistaken on two counts. First of all, a CObject is not a container. It can't prevent cyclic GC because it's never a part of a cycle. Second, CObjects do not have a __del__ method. They call the supplied constructor from the type's tp_dealloc slot. Use of the tp_dealloc slot does not, by itself, prevent cyclic GC. Bottom line is, the CObject's deallocator is as reliable as a custom type's tp_dealloc. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list