diff options
author | Victor Stinner <vstinner@python.org> | 2023-11-13 16:14:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 16:14:56 (GMT) |
commit | babb787047e0f7807c8238d3b1a3128dac30bd5c (patch) | |
tree | 868cd78ee07ef9c20a5af32db79f979c543b8f0e /Include/cpython | |
parent | 29af7369dbbbba8cefafb196e977bce8189a527d (diff) | |
download | cpython-babb787047e0f7807c8238d3b1a3128dac30bd5c.zip cpython-babb787047e0f7807c8238d3b1a3128dac30bd5c.tar.gz cpython-babb787047e0f7807c8238d3b1a3128dac30bd5c.tar.bz2 |
gh-111138: Add PyList_Extend() and PyList_Clear() functions (#111862)
* Split list_extend() into two sub-functions: list_extend_fast() and
list_extend_iter().
* list_inplace_concat() no longer has to call Py_DECREF() on the
list_extend() result, since list_extend() now returns an int.
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/listobject.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/cpython/listobject.h b/Include/cpython/listobject.h index c4d9052..8ade1b1 100644 --- a/Include/cpython/listobject.h +++ b/Include/cpython/listobject.h @@ -44,3 +44,6 @@ PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) { } #define PyList_SET_ITEM(op, index, value) \ PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) + +PyAPI_FUNC(int) PyList_Extend(PyObject *self, PyObject *iterable); +PyAPI_FUNC(int) PyList_Clear(PyObject *self); |