From 6493b259363169d3ef0506a063da0b54bf4b90dc Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 14 Jul 2024 18:44:07 +0900 Subject: [PATCH 1/3] Address code review --- Doc/c-api/list.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index 53eb54d3e1021a..df8ce98e1bd125 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -38,9 +38,14 @@ 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` + - :c:func:`PyList_SET_ITEM()` + .. c:function:: Py_ssize_t PyList_Size(PyObject *list) From fe8325bf74014f171e3ede73ffae34e6a8c0c5d0 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 14 Jul 2024 18:44:46 +0900 Subject: [PATCH 2/3] nit --- Doc/c-api/list.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index df8ce98e1bd125..d0b3c35ed1f91b 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -43,7 +43,7 @@ List Objects 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` + - :c:func:`PyList_SetItem()` - :c:func:`PyList_SET_ITEM()` From caa1c7d034a09563087379da678af2655d68f6ad Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Sun, 14 Jul 2024 19:57:37 +0900 Subject: [PATCH 3/3] Address review --- Doc/c-api/list.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index d0b3c35ed1f91b..758415a76e5cb4 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -42,9 +42,7 @@ List Objects :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()` - - :c:func:`PyList_SET_ITEM()` + the list is fully initialized: :c:func:`PyList_SetItem()` and :c:func:`PyList_SET_ITEM()`.