Skip to content

sync abstract.h bindings to Python 3.14#5942

Merged
ngoldbaum merged 9 commits intoPyO3:mainfrom
davidhewitt:ffi-abstract
Apr 14, 2026
Merged

sync abstract.h bindings to Python 3.14#5942
ngoldbaum merged 9 commits intoPyO3:mainfrom
davidhewitt:ffi-abstract

Conversation

@davidhewitt
Copy link
Copy Markdown
Member

Part of #5592, this is the messiest piece I think.

@davidhewitt davidhewitt marked this pull request as ready for review April 11, 2026 19:37
@davidhewitt davidhewitt requested a review from ngoldbaum April 13, 2026 08:27
Comment thread pyo3-ffi/src/abstract_.rs Outdated
Copy link
Copy Markdown
Contributor

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

Did a once-over. Claude spotted the type error on the PyVectorcall_NARGS bindings FWIW.

Comment thread pyo3-ffi/src/abstract_.rs
Comment thread pyo3-ffi/src/cpython/abstract_.rs
Comment thread pyo3-ffi/src/abstract_.rs Outdated

#[cfg(all(Py_3_12, Py_LIMITED_API))] // is an inline function in cpython/abstract.rs on version-specific ABI
#[cfg_attr(PyPy, link_name = "PyPyVectorcall_NARGS")]
pub fn PyVectorcall_NARGS(nargsf: size_t) -> size_t;
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.

This should return a Py_ssize_t. Does the updated ffi checker also check the return type?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No sadly in #5965 I don't attempt to reconcile function argument types, just argument count.

(The bindgen code in pyo3-ffi-check creates a completely unrelated definition for PyObject to the one in pyo3-ffi, so "naively" the check legitimately sees different types.)

Comment thread pyo3-ffi/src/abstract_.rs
Comment thread pyo3-ffi/src/cpython/abstract_.rs
Comment thread pyo3-ffi/src/cpython/abstract_.rs
@davidhewitt
Copy link
Copy Markdown
Member Author

Thanks, fixed the type error and replied to other comments 👍

@ngoldbaum ngoldbaum enabled auto-merge April 14, 2026 20:30
@ngoldbaum ngoldbaum added this pull request to the merge queue Apr 14, 2026
Merged via the queue into PyO3:main with commit 962a535 Apr 14, 2026
87 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants