Skip to content

Commit bdc9263

Browse files
committed
Move functions in the doc
1 parent dd6484b commit bdc9263

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Doc/c-api/list.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@ List Objects
9898
leaked.
9999
100100
101-
.. c:function:: int PyList_Clear(PyObject *list)
102-
103-
Remove all items from *list*. This is the same as
104-
``PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL)`` and analogous to
105-
``list.clear()`` or ``del list[:]``.
106-
107-
Raise an exception and return ``-1`` if *list* is not a :class:`list`
108-
object. Return 0 on success.
109-
110-
.. versionadded:: 3.13
111-
112-
113101
.. c:function:: int PyList_Insert(PyObject *list, Py_ssize_t index, PyObject *item)
114102
115103
Insert the item *item* into list *list* in front of index *index*. Return
@@ -124,6 +112,22 @@ List Objects
124112
to ``list.append(item)``.
125113
126114
115+
.. c:function:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
116+
117+
Return a list of the objects in *list* containing the objects *between* *low*
118+
and *high*. Return ``NULL`` and set an exception if unsuccessful. Analogous
119+
to ``list[low:high]``. Indexing from the end of the list is not supported.
120+
121+
122+
.. c:function:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
123+
124+
Set the slice of *list* between *low* and *high* to the contents of
125+
*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may
126+
be ``NULL``, indicating the assignment of an empty list (slice deletion).
127+
Return ``0`` on success, ``-1`` on failure. Indexing from the end of the
128+
list is not supported.
129+
130+
127131
.. c:function:: int PyList_Extend(PyObject *list, PyObject *iterable)
128132
129133
Extend *list* with the contents of *iterable*. This is the same as
@@ -136,20 +140,16 @@ List Objects
136140
.. versionadded:: 3.13
137141
138142
139-
.. c:function:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
140-
141-
Return a list of the objects in *list* containing the objects *between* *low*
142-
and *high*. Return ``NULL`` and set an exception if unsuccessful. Analogous
143-
to ``list[low:high]``. Indexing from the end of the list is not supported.
143+
.. c:function:: int PyList_Clear(PyObject *list)
144144
145+
Remove all items from *list*. This is the same as
146+
``PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL)`` and analogous to
147+
``list.clear()`` or ``del list[:]``.
145148
146-
.. c:function:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
149+
Raise an exception and return ``-1`` if *list* is not a :class:`list`
150+
object. Return 0 on success.
147151
148-
Set the slice of *list* between *low* and *high* to the contents of
149-
*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may
150-
be ``NULL``, indicating the assignment of an empty list (slice deletion).
151-
Return ``0`` on success, ``-1`` on failure. Indexing from the end of the
152-
list is not supported.
152+
.. versionadded:: 3.13
153153
154154
155155
.. c:function:: int PyList_Sort(PyObject *list)

0 commit comments

Comments
 (0)