Object finalization

Tobbi tomas.bouda at systinet.com
Fri Dec 5 11:38:20 EST 2003


   Hi,
I have a question about Python object finalization. I would like to be notified when an Object is deallocated. The problem is I would like to do it in C.
The only way to register a finalizer I found out is to create a weak reference object and give it a callback. But the callback must be a Python function not C. That seems to be too difficult.

Is there any (undocumented) way to do PyObject_RegisterFinalizer(PyObject *o, C-Callback-Func)?

   Thanks a lot.

Best Regards,
Tobbi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20031205/b061d8c6/attachment.html>


More information about the Python-list mailing list