Skip to content

gh-144175: Add PyArg_ParseArray() function#144283

Merged
vstinner merged 9 commits intopython:mainfrom
vstinner:parse_vector
Mar 6, 2026
Merged

gh-144175: Add PyArg_ParseArray() function#144283
vstinner merged 9 commits intopython:mainfrom
vstinner:parse_vector

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jan 27, 2026

@vstinner
Copy link
Member Author

The change doesn't include tests because my plan is to write a following PR to rename _PyArg_ParseStack() to PyArg_ParseVector(). Many modules using Argument Clinic are calling _PyArg_ParseStack(). I prefer to write a separated PR since it changes a lot of code and so is harder to review.

vstinner and others added 4 commits January 28, 2026 11:24
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@vstinner vstinner marked this pull request as ready for review January 28, 2026 15:09
@vstinner
Copy link
Member Author

Ok, I completed the PR to add also PyArg_ParseVectorAndKeywords() function. The PR is now ready for review :-)

@vstinner
Copy link
Member Author

I propose the following API:

int PyArg_ParseVector(
    PyObject *const *args,
    Py_ssize_t nargs,
    const char *format,
    ...);

int PyArg_ParseVectorAndKeywords(
    PyObject *const *args,
    Py_ssize_t nargs,
    PyObject *kwnames,
    const char *format,
    char * const *kwlist,
    ...);

@vstinner
Copy link
Member Author

vstinner commented Feb 2, 2026

I created a C API Working Group decision issue: capi-workgroup/decisions#97.

@vstinner vstinner requested a review from ZeroIntensity as a code owner March 6, 2026 21:03
@vstinner
Copy link
Member Author

vstinner commented Mar 6, 2026

The C API Working Group approved the API: capi-workgroup/decisions#97

@vstinner vstinner changed the title gh-144175: Add PyArg_ParseVector() function gh-144175: Add PyArg_ParseArray() function Mar 6, 2026
@vstinner vstinner enabled auto-merge (squash) March 6, 2026 21:32
@vstinner vstinner merged commit 9159287 into python:main Mar 6, 2026
50 checks passed
@vstinner vstinner deleted the parse_vector branch March 6, 2026 21:57
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.

3 participants