@@ -98,18 +98,6 @@ List Objects
98
98
leaked.
99
99
100
100
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
-
113
101
.. c :function :: int PyList_Insert (PyObject *list, Py_ssize_t index, PyObject *item)
114
102
115
103
Insert the item *item * into list *list * in front of index *index *. Return
@@ -124,6 +112,22 @@ List Objects
124
112
to ``list.append(item) ``.
125
113
126
114
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
+
127
131
.. c:function:: int PyList_Extend(PyObject *list, PyObject *iterable)
128
132
129
133
Extend *list * with the contents of *iterable *. This is the same as
@@ -136,20 +140,16 @@ List Objects
136
140
.. versionadded :: 3.13
137
141
138
142
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)
144
144
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[:] ``.
145
148
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.
147
151
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
153
153
154
154
155
155
.. c :function :: int PyList_Sort (PyObject *list)
0 commit comments