gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page#96259
gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page#96259JelleZijlstra merged 2 commits intopython:mainfrom
Conversation
| The macros in this section are used for managing reference counts of Python | ||
| objects. | ||
| objects. Note that :c:macro:`Py_REFCNT` and :c:macro:`Py_SET_REFCNT` are | ||
| documented as a part of :c:type:`PyObject`. |
There was a problem hiding this comment.
IMHO, I think it would be cleaner to move those from structures.rst to here, rather than just referring to them. They are clearly in the "reference counting" category.
There was a problem hiding this comment.
you know, i started out assuming there was a reason they were elsewhere, but now that you mention it this is just another area describing functions that apply specifically to PyObjects, so there is really no justification i can think of for why Py_REFCNT is any different
ima push in a bit
e: pushed
There was a problem hiding this comment.
IMHO, I think it would be cleaner to move those from
structures.rstto here, rather than just referring to them. They are clearly in the "reference counting" category.
hey anybody you know of I could bug to get this merged?
There was a problem hiding this comment.
I think the reason they were in structures.rst is that these macros directly get/set a field on the PyObject, just like the macros listed above and below it. I agree that these macros are best placed in the refcounting docs, but we should also keep a reference to them in structure.rst.
Also, there's a merge conflict now. Sorry for the wait; once these issues are resolved I'm happy to merge this PR.
There was a problem hiding this comment.
I think the reason they were in structures.rst is that these macros directly get/set a field on the PyObject, just like the macros listed above and below it. I agree that these macros are best placed in the refcounting docs, but we should also keep a reference to them in structure.rst.
Also, there's a merge conflict now. Sorry for the wait; once these issues are resolved I'm happy to merge this PR.
how about the newly pushed thing?
d18bdc5 to
8fe4010
Compare
8fe4010 to
887dee3
Compare
|
rebased (merge conflict should be cleared now) |
…rence counting page
…find other macros that can be applied to PyObject
887dee3 to
2a75382
Compare
This is I think a relatively trivial change to resolve an issue I ran into, where I briefly and mistakenly thought there was not a macro to check the reference count on a PyObject due to it not being mentioned on the reference counting page.