-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Fix documentation for gcvisitobjects_t #132433
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
Conversation
Documented behaviour is the exact opposite of the real behaviour. See comment in the code https://github.com/python/cpython/blob/ad3bbe8fbcc9045c436b0c5e49b1aec018c59c2d/Include/cpython/objimpl.h#L92-L93 and code https://github.com/python/cpython/blob/ad3bbe8fbcc9045c436b0c5e49b1aec018c59c2d/Python/gc.c#L2405
This is correct though? because |
I think that's consistent - the code comment and the code say the same thing - that returning |
Ah! I thought that the error was in the C comment, not the rst comment (and since the text is almost the same I didn't see I was looking at the rst). My bad! |
@hugovk This kind of doc update could be backported in 3.12 because otherwise users will have a pretty important API misuse. Can this be considered backportable? |
We normally only backport security fixes to security branches. I expect most people read the docs at But this is a small, safe change, so you can ask 3.12 RM Thomas if you'd like an exception. |
`gcvisitobjects_t` callbacks should return 1 for the iteration to continue instead of 0. (cherry picked from commit 1e5798e) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
GH-132441 is a backport of this pull request to the 3.13 branch. |
@Yhg1s Would you be willing to consider this change as a backportable one? (note that the typedef was added in 3.12) |
Documented behaviour is the exact opposite of the real behaviour.
See comment in the code
cpython/Include/cpython/objimpl.h
Lines 92 to 94 in ad3bbe8
and code
cpython/Python/gc.c
Lines 2403 to 2406 in ad3bbe8
📚 Documentation preview 📚: https://cpython-previews--132433.org.readthedocs.build/