diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-11-07 21:40:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-07 21:40:03 (GMT) |
commit | 1f777396f52a4cf7417f56097f10add8042295f4 (patch) | |
tree | d2b16073b0665beba75e900fff1dd2daf24b0717 /Include/internal/pycore_tuple.h | |
parent | 09d6f5dc7824c74672add512619e978844ff8051 (diff) | |
download | cpython-1f777396f52a4cf7417f56097f10add8042295f4.zip cpython-1f777396f52a4cf7417f56097f10add8042295f4.tar.gz cpython-1f777396f52a4cf7417f56097f10add8042295f4.tar.bz2 |
gh-122943: Rework support of var-positional parameter in Argument Clinic (GH-122945)
Move creation of a tuple for var-positional parameter out of
_PyArg_UnpackKeywordsWithVararg().
Merge _PyArg_UnpackKeywordsWithVararg() with _PyArg_UnpackKeywords().
Add a new parameter in _PyArg_UnpackKeywords().
The "parameters" and "converters" attributes of ParseArgsCodeGen no
longer contain the var-positional parameter. It is now available as the
"varpos" attribute. Optimize code generation for var-positional
parameter and reuse the same generating code for functions with and without
keyword parameters.
Add special converters for var-positional parameter. "tuple" represents it as
a Python tuple and "array" represents it as a continuous array of PyObject*.
"object" is a temporary alias of "tuple".
Diffstat (limited to 'Include/internal/pycore_tuple.h')
-rw-r--r-- | Include/internal/pycore_tuple.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/internal/pycore_tuple.h b/Include/internal/pycore_tuple.h index dfbbd6f..82b8752 100644 --- a/Include/internal/pycore_tuple.h +++ b/Include/internal/pycore_tuple.h @@ -20,7 +20,7 @@ extern PyStatus _PyTuple_InitGlobalObjects(PyInterpreterState *); #define _PyTuple_ITEMS(op) _Py_RVALUE(_PyTuple_CAST(op)->ob_item) -extern PyObject *_PyTuple_FromArray(PyObject *const *, Py_ssize_t); +PyAPI_FUNC(PyObject *)_PyTuple_FromArray(PyObject *const *, Py_ssize_t); PyAPI_FUNC(PyObject *)_PyTuple_FromStackRefSteal(const union _PyStackRef *, Py_ssize_t); PyAPI_FUNC(PyObject *)_PyTuple_FromArraySteal(PyObject *const *, Py_ssize_t); |