]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121403: Add notes for PyList_GetXXX APIs about the need for init (gh-121626)
authorDonghee Na <donghee.na@python.org>
Tue, 16 Jul 2024 01:16:41 +0000 (10:16 +0900)
committerGitHub <noreply@github.com>
Tue, 16 Jul 2024 01:16:41 +0000 (10:16 +0900)
Doc/c-api/list.rst

index 53eb54d3e1021a3a1b06003a3e2ae1b8549a6921..758415a76e5cb41198fbd5b1bcdd4e6e59346142 100644 (file)
@@ -38,9 +38,12 @@ List Objects
    .. note::
 
       If *len* is greater than zero, the returned list object's items are
-      set to ``NULL``.  Thus you cannot use abstract API functions such as
-      :c:func:`PySequence_SetItem`  or expose the object to Python code before
-      setting all items to a real object with :c:func:`PyList_SetItem`.
+      set to ``NULL``. Thus you cannot use abstract API functions such as
+      :c:func:`PySequence_SetItem` or expose the object to Python code before
+      setting all items to a real object with :c:func:`PyList_SetItem` or
+      :c:func:`PyList_SET_ITEM()`. The following APIs are safe APIs before
+      the list is fully initialized: :c:func:`PyList_SetItem()` and :c:func:`PyList_SET_ITEM()`.
+
 
 
 .. c:function:: Py_ssize_t PyList_Size(PyObject *list)