Object finalization

T

Tobbi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top