Skip to content

bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API #19461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2020

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 10, 2020

@pablogsal pablogsal requested a review from vstinner April 10, 2020 23:44
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Fun fact: PyObject_GC_Track() is documented to accept "PyObject *", whereas it currently accepts "void *".
https://docs.python.org/dev/c-api/gcsupport.html#c.PyObject_GC_Track

@@ -3588,7 +3588,7 @@ slot_tp_del(PyObject *self)
_Py_NewReference(self);
Py_SET_REFCNT(self, refcnt);
}
assert(!PyType_IS_GC(Py_TYPE(self)) || _PyObject_GC_IS_TRACKED(self));
assert(!PyType_IS_GC(Py_TYPE(self)) || PyObject_GC_IsTracked(self));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this change :-)

@pablogsal pablogsal merged commit f13072b into python:master Apr 11, 2020
@pablogsal pablogsal deleted the bpo-40241 branch April 11, 2020 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants