You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add public PyArg_ParseTupleAndKeywords API equivalent for METH_FASTCALL #144175
METH_FASTCALL is part of the stable ABI as of Python 3.10. However, using it in extension module is quite difficult, because there is no equivalent API for PyArg_ParseTupleAndKeywords (which is the usual way to parse complex signatures with keywords in METH_VARARGS-style functions), and parsing vectorcall-style keywords is not a trivial problem to begin with. There used to be an undocumented public API (_PyArg_ParseStackAndKeywords) that solves this problem that is used by Argument Clinic, but it was removed from the public API as part of a wider effort to unexpose undocumented APIs in #110964.
So this issue requests a new public, stable API similar to PyArg_ParseTuple and PyArg_ParseTupleAndKeywords but accepting vectorcall-style parameters instead.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
vstinner commentedon Jan 23, 2026
Python has a private API but this private API has been moved to the internal C API in Python 3.13:
vstinner commentedon Jan 23, 2026
The problem of
_PyArg_ParseStackAndKeywords()is that it uses_PyArg_Parserstructure which is complex to initialize.Example of code generated by Argument Clinic for
_gdbm.gdbm.nextkey()function to parse a string (with its length):vstinner commentedon Jan 23, 2026
cc @serhiy-storchaka
pythongh-144175: Add PyArg_ParseVector() function
pythongh-144175: Add PyArg_ParseVector() function
vstinner commentedon Jan 27, 2026
I wrote #144283 to add
PyArg_ParseVector()function: a first incomplete solution to this issue.gh-144175: Add PyArg_ParseArray() function (#144283)
vstinner commentedon Mar 9, 2026
Thanks for the report @rdb, it's now implemented in Python 3.15.
The final change adds PyArg_ParseArray() and PyArg_ParseArrayAndKeywords(), so keywords are supported as well.
rdb commentedon Mar 10, 2026
Thanks a lot!
pythongh-144175: Add PyArg_ParseArray() function (python#144283)
gh-144175: Remove internal _PyArg_ParseStack() function (#159150)