Skip to content

Cpython internal apis#5946

Merged
davidhewitt merged 9 commits intoPyO3:mainfrom
codeguru42:cpython-internal-apis
Apr 13, 2026
Merged

Cpython internal apis#5946
davidhewitt merged 9 commits intoPyO3:mainfrom
codeguru42:cpython-internal-apis

Conversation

@codeguru42
Copy link
Copy Markdown
Contributor

This PR cleans up a few more _Py* symbols per #3762. This may conflict with some changes in #5592, mostly because I am marking items as deprecated instead of removing. If we prefer to remove instead, I'll be happy to do so. Hopefully something here is helpful moving this forward.

@codeguru42 codeguru42 force-pushed the cpython-internal-apis branch from 7a5fee9 to f99aba0 Compare April 3, 2026 22:30
@codeguru42 codeguru42 force-pushed the cpython-internal-apis branch from f99aba0 to 87f688b Compare April 9, 2026 13:04
Copy link
Copy Markdown
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think we can (and should) be a little bit more aggressive with the removals since these are CPython private symbols.

Comment thread pyo3-ffi/src/longobject.rs Outdated
Comment thread pyo3-ffi/src/setobject.rs Outdated
note = "`_PySet_NextEntry` is a CPython-internal API with no stability guarantee; iterate sets using `PyObject_GetIter` / `PyIter_Next` instead"
)]
#[cfg_attr(PyPy, link_name = "_PyPySet_NextEntry")]
pub fn _PySet_NextEntry(
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 we can just immediately remove this; the private definitions have no stability guarantees.

@codeguru42
Copy link
Copy Markdown
Contributor Author

@davidhewitt back to you

@davidhewitt
Copy link
Copy Markdown
Member

Thanks, looks good to me. To fix CI you'll need to remove the macro branch for _PySet_NextEntry that still exists inside pyo3-ffi

@codeguru42
Copy link
Copy Markdown
Contributor Author

@davidhewitt back to you again

@davidhewitt
Copy link
Copy Markdown
Member

Super, thanks again!

@davidhewitt davidhewitt added this pull request to the merge queue Apr 13, 2026
Merged via the queue into PyO3:main with commit 608a183 Apr 13, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants