Lines Matching defs:list
5 #include "pycore_interp.h" // PyInterpreterState.list
12 class list "PyListObject *" "&PyList_Type"
18 _Py_DECLARE_STR(list_err, "list index out of range");
25 return &interp->list;
52 the allocated size, then proceed with the realloc() to shrink the list.
60 /* This over-allocates proportional to the list size, making room
123 struct _Py_list_state *state = &interp->list;
137 struct _Py_list_state *state = &interp->list;
250 _Py_DECLARE_STR(list_err, "list index out of range");
270 "list assignment index out of range");
353 thrashing when a *very* large list is created and
403 /* Do repr() on each element. Note that this may mutate the list,
404 so must refetch the list size on each iteration. */
524 "can only concatenate list (not \"%.200s\") to list",
611 this list, we make it empty first. */
622 Note that there is no guarantee that the list is actually empty
636 /* Because [X]DECREF can recursively invoke list operations on
637 this list, we must postpone all [X]DECREF activity until
638 after the list is back in its canonical shape. Therefore
641 list. :-( */
647 Py_ssize_t n; /* # of elements in replacement list */
648 Py_ssize_t norig; /* # of elements in list getting replaced */
793 "list assignment index out of range");
804 list.insert
823 list.clear
825 Remove all items from list.
837 list.copy
839 Return a shallow copy of the list.
850 list.append
855 Append object to the end of the list.
869 list.extend
874 Extend list by appending elements from the iterable.
904 /* It should not be possible to allocate a list large enough to cause
939 /* Guess a result list size. */
960 /* Make the list sane again. */
987 /* Cut back result list if initial guess was too large. */
1021 list.pop
1028 Raises IndexError if list is empty or index is out of range.
1040 PyErr_SetString(PyExc_IndexError, "pop from empty list");
1053 return v; /* and v now owns the reference the list had */
1066 /* Reverse a slice of a list in place, from lo up to (exclusive) hi. */
1166 * For a list with n elements, this needs at most floor(log2(n)) + 1 entries
1227 * when we know our list is type-homogeneous but we can't assume anything else.
1240 [lo, hi) is a contiguous slice of a list, and is sorted via
1548 /* The temporary space for merging will need at most half the list
1956 * the second run (starting at index s1+n1) has length n2. The list has total
2205 * but run on the list [x[0] for x in L]. This allows us to optimize compares
2246 * list will be some permutation of its input state (nothing is lost or
2250 list.sort
2256 Sort the list in ascending order and return None.
2258 The sort is in-place (i.e. the list itself is modified) and stable (i.e. the
2261 If a key function is given, apply it once to each list item and sort them,
2287 /* The list is temporarily made empty, so that mutations performed
2337 /* Assume the first element is representative of the whole list. */
2368 /* If keys are in tuple we must loop over the whole list to make
2416 * (remember: here, key_type refers list [key[0] for key in keys]) */
2435 /* Reverse sort stability achieved by initially reversing the list,
2500 /* The user mucked with the list during the sort,
2503 PyErr_SetString(PyExc_ValueError, "list modified during sort");
2520 guarantee that the list is really empty when it returns */
2547 list.reverse
2586 list.index
2625 PyErr_Format(PyExc_ValueError, "%R is not in list", value);
2630 list.count
2663 list.remove
2693 PyErr_SetString(PyExc_ValueError, "list.remove(x): x not in list");
2764 list.__init__
2771 If no argument is given, the constructor creates a new empty list.
2779 /* Verify list invariants established by PyType_GenericAlloc() */
2802 if (!_PyArg_NoKwnames("list", kwnames)) {
2806 if (!_PyArg_CheckPositional("list", nargs, 0, 1)) {
2810 PyObject *list = PyType_GenericAlloc(_PyType_CAST(type), 0);
2811 if (list == NULL) {
2815 if (list___init___impl((PyListObject *)list, args[0])) {
2816 Py_DECREF(list);
2820 return list;
2825 list.__sizeof__
2827 Return the size of the list in memory, in bytes.
2924 "list indices must be integers or slices, not %.200s",
2984 list that are *not* part of the slice: step-1
2986 and then tail end of the list that was not
3087 "list indices must be integers or slices, not %.200s",
3101 "list",
3160 PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
3353 list.__reversed__
3355 Return a reverse iterator over the list.
3453 PyObject *list;
3481 /* empty iterator, create an empty list */
3482 list = PyList_New(0);
3483 if (list == NULL)
3485 return Py_BuildValue("N(N)", _PyEval_GetBuiltin(&_Py_ID(iter)), list);