-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page #96259
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
Doc/c-api/refcounting.rst
Outdated
@@ -8,7 +8,8 @@ Reference Counting | |||
****************** | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
hey anybody you know of I could bug to get this merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.