Hi,

PEP 442 says "Two new C API functions are provided to ease calling of
tp_finalize, especially from custom deallocators."

This includes PyObject_CallFinalizerFromDealloc. However, no
documentation of these functions appears to exist (https://bugs.python.
org/issue31276).

As far as I understand, if you have a custom tp_dealloc, you *have* to
call PyObject_CallFinalizerFromDealloc in order to get your tp_finalize
called. Is this correct?

However, since the necessary functions are undocumented, it's unclear
if they were intended to be public Python API functions. So are they
actually public functions that 3rd party extensions can call?
If not, how is tp_finalize supposed to be used?

I'd be happy if someone can clarify the issue.

-- 
Pauli Virtanen
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to