-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Immortal objects and the C API docs #104597
Comments
Oh that's a great point, let me make a note of this to go through the C-API Docs this weekend and update all the relevant singletons. Debating whether to add a 3.12 note only or if we should change the whole section to reflect immortality and just have a note for < 3.11 |
The docs are per-version, so the 3.12 docs should document the state of 3.12. It's good to include a |
This has now been addressed by @iritkatriel in GH-105195! We can probably close this issue now 🙂 |
Sorry I didn't notice this issue. My PR is not reviewed/merged yet though. |
Ah my bad, you are right, I misread. Alright let's see if we can push your PR to resolve this issue |
It looks like most of the objects in question have been documented with an immortality note, is there anything else to do here? |
I confirm that the doc has been updated. I close the issue. |
https://docs.python.org/3.12/c-api/none.html#c.Py_None currently says that Py_None "needs to be treated just like any other object with respect to reference counts". That's not really true now that we have PEP-683 immortal objects: there is no need to incref/decref it. There are several similar places, e.g. https://docs.python.org/3.12/c-api/slice.html#ellipsis-object and https://docs.python.org/3.12/c-api/bool.html#c.Py_False.
The docs should be updated to somehow refer to the fact that these objects are immortal. However, extension authors who want to retain support for 3.11 and lower should continue to refcount None etc. correctly, so we shouldn't completely omit discussion of refcounting.
cc @eduardo-elizondo
The text was updated successfully, but these errors were encountered: