Hi, thanks to your report. > 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?
Sorry, I'm not expert of Object finalization process. But If my understanding is correct, you're almost right. When a type has custom *tp_finalize*, it have to call `PyObject_CallFinalizerFromDealloc`. And to allow subclass, it should be like this: https://github.com/python/cpython/blob/ed94a8b2851914bcda3a77b28b25517b8baa91e6/Modules/_asynciomodule.c#L1836-L1849 > 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? While I don't want tp_finalize is used widely (like `__del__`), I agree with you. But I'm not good English writer. Contribution is welcome. Regards, INADA Naoki <songofaca...@gmail.com> _______________________________________________ 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