◐ Shell
clean mode source ↗

bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API by pablogsal · Pull Request #19461 · python/cpython

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@pablogsal

@pablogsal pablogsal commented

Apr 10, 2020

edited

Loading

Copy link Copy Markdown

Member

Comment thread

Modules/gcmodule.c Outdated

Comment thread

Doc/c-api/gcsupport.rst

Comment thread

Doc/c-api/gcsupport.rst

Comment thread

Doc/c-api/gcsupport.rst Outdated

@pablogsal pablogsal requested a review from vstinner

April 10, 2020 23:44

@vstinner vstinner left a comment

Copy link Copy Markdown

Member

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

Comment thread

Modules/_testcapimodule.c

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 Copy Markdown

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 reacted with rocket emoji

@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

Reviewers

@vstinner vstinner vstinner approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@pablogsal @vstinner @the-knights-who-say-ni @bedevere-bot