Skip to content

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

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

QuakeIV
Copy link
Contributor

@QuakeIV QuakeIV commented Aug 25, 2022

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.

@ghost
Copy link

ghost commented Aug 25, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@@ -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`.
Copy link
Contributor

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.

Copy link
Contributor Author

@QuakeIV QuakeIV Aug 26, 2022

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

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

@QuakeIV QuakeIV Oct 12, 2022

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?

@QuakeIV QuakeIV force-pushed the refcnt_doc_update branch from d18bdc5 to 8fe4010 Compare August 26, 2022 06:21
@QuakeIV QuakeIV changed the title gh-96258: mention Py_REFCNT and Py_SET_REFCNT on the reference counting page gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page Aug 26, 2022
@JelleZijlstra JelleZijlstra self-assigned this Oct 7, 2022
@QuakeIV QuakeIV force-pushed the refcnt_doc_update branch from 8fe4010 to 887dee3 Compare October 9, 2022 00:00
@QuakeIV
Copy link
Contributor Author

QuakeIV commented Oct 9, 2022

rebased (merge conflict should be cleared now)

@QuakeIV QuakeIV requested review from JelleZijlstra and removed request for encukou October 14, 2022 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants