diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index 53eb54d3e1021a3..f4bc138594e3fc4 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -65,17 +65,29 @@ List Objects .. versionadded:: 3.13 + .. note:: + You can not use this function until all items are set to real objects + with :c:func:`PyList_SetItem` or :c:func:`PyList_SET_ITEM`. + .. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index) Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` instead of a :term:`strong reference`. + .. note:: + You can not use this function until all items are set to real objects + with :c:func:`PyList_SetItem` or :c:func:`PyList_SET_ITEM`. + .. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i) Similar to :c:func:`PyList_GetItem`, but without error checking. + .. note:: + You can not use this function until all items are set to real objects + with :c:func:`PyList_SetItem` or :c:func:`PyList_SET_ITEM`. + .. c:function:: int PyList_SetItem(PyObject *list, Py_ssize_t index, PyObject *item)