Skip to content

gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page#96259

Merged
JelleZijlstra merged 2 commits intopython:mainfrom
QuakeIV:refcnt_doc_update
Oct 15, 2022
Merged

gh-96258: move Py_REFCNT and Py_SET_REFCNT to reference counting page#96259
JelleZijlstra merged 2 commits intopython:mainfrom
QuakeIV:refcnt_doc_update

Conversation

@QuakeIV
Copy link
Copy Markdown
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
Copy Markdown

ghost commented Aug 25, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

Comment thread Doc/c-api/refcounting.rst Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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