What's the public API alternative to _PyObject_GC_IS_TRACKED()?

Marco Sulla Marco.Sulla.Python at gmail.com
Wed Dec 29 02:10:20 EST 2021


On Wed, 29 Dec 2021 at 07:46, Inada Naoki <songofacandy at gmail.com> wrote:
> You are right. I thought PyObject_GC_Track() can be used to tracked
> objects because PyObject_GC_Untrack() can be used untracked object.
> I think there is no enough reason for this asymmetry.
>
> Additionally, adding PyObject_GC_IsTracked() to public API will not
> bother future Python improvements.
> If Python changed its GC to mark-and-sweep, PyObject_GC_IsTracked()
> can return true always.

I think you are right :)


More information about the Python-list mailing list