Lines Matching full:list
5 List Objects
8 .. index:: object: list
13 This subtype of :c:type:`PyObject` represents a Python list object.
18 This instance of :c:type:`PyTypeObject` represents the Python list type.
19 This is the same object as :class:`list` in the Python layer.
24 Return true if *p* is a list object or an instance of a subtype of the list
30 Return true if *p* is a list object, but not an instance of a subtype of
31 the list type.
36 Return a new list of length *len* on success, or *NULL* on failure.
40 If *len* is greater than zero, the returned list object's items are
46 .. c:function:: Py_ssize_t PyList_Size(PyObject *list)
50 Return the length of the list object in *list*; this is equivalent to
51 ``len(list)`` on a list object.
54 .. c:function:: Py_ssize_t PyList_GET_SIZE(PyObject *list)
59 .. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
61 Return the object at position *index* in the list pointed to by *list*. The
62 position must be positive, indexing from the end of the list is not
67 .. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
72 .. c:function:: int PyList_SetItem(PyObject *list, Py_ssize_t index, PyObject *item)
74 Set the item at index *index* in list to *item*. Return ``0`` on success
80 an item already in the list at the affected position.
83 .. c:function:: void PyList_SET_ITEM(PyObject *list, Py_ssize_t i, PyObject *o)
92 is being replaced; any reference in *list* at position *i* will be
96 .. c:function:: int PyList_Insert(PyObject *list, Py_ssize_t index, PyObject *item)
98 Insert the item *item* into list *list* in front of index *index*. Return
100 Analogous to ``list.insert(index, item)``.
103 .. c:function:: int PyList_Append(PyObject *list, PyObject *item)
105 Append the object *item* at the end of list *list*. Return ``0`` if
107 to ``list.append(item)``.
110 .. c:function:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
112 Return a list of the objects in *list* containing the objects *between* *low*
114 to ``list[low:high]``. Negative indices, as when slicing from Python, are not
118 .. c:function:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *item…
120 Set the slice of *list* between *low* and *high* to the contents of
121 *itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may
122 be *NULL*, indicating the assignment of an empty list (slice deletion).
127 .. c:function:: int PyList_Sort(PyObject *list)
129 Sort the items of *list* in place. Return ``0`` on success, ``-1`` on
130 failure. This is equivalent to ``list.sort()``.
133 .. c:function:: int PyList_Reverse(PyObject *list)
135 Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on
136 failure. This is the equivalent of ``list.reverse()``.
139 .. c:function:: PyObject* PyList_AsTuple(PyObject *list)
143 Return a new tuple object containing the contents of *list*; equivalent to
144 ``tuple(list)``.
149 Clear the free list. Return the total number of freed items.