Skip to content

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 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,
    ...);

Py_ssize_t nargs,
PyObject *kwnames,
const char *format,
PY_CXX_CONST char * const *kwlist,
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to have PY_CXX_CONST? why now always const char *const *kwlist? (are there occurrences where we don't have a const?)

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.

2 participants