• Home
  • Raw
  • Download

Lines Matching full:start

56    start, stop, and step are python objects with None indicating no
61 PySlice_New(PyObject *start, PyObject *stop, PyObject *step) in PySlice_New() argument
70 if (start == NULL) start = Py_None; in PySlice_New()
71 Py_INCREF(start); in PySlice_New()
76 obj->start = start; in PySlice_New()
86 PyObject *start, *end, *slice; in _PySlice_FromIndices() local
87 start = PyInt_FromSsize_t(istart); in _PySlice_FromIndices()
88 if (!start) in _PySlice_FromIndices()
92 Py_DECREF(start); in _PySlice_FromIndices()
96 slice = PySlice_New(start, end, NULL); in _PySlice_FromIndices()
97 Py_DECREF(start); in _PySlice_FromIndices()
104 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) in PySlice_GetIndices() argument
113 if (r->start == Py_None) { in PySlice_GetIndices()
114 *start = *step < 0 ? length-1 : 0; in PySlice_GetIndices()
116 if (!PyInt_Check(r->start) && !PyLong_Check(r->step)) return -1; in PySlice_GetIndices()
117 *start = PyInt_AsSsize_t(r->start); in PySlice_GetIndices()
118 if (*start < 0) *start += length; in PySlice_GetIndices()
128 if (*start >= length) return -1; in PySlice_GetIndices()
135 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength) in PySlice_GetIndicesEx() argument
156 if (r->start == Py_None) { in PySlice_GetIndicesEx()
157 *start = defstart; in PySlice_GetIndicesEx()
160 if (!_PyEval_SliceIndex(r->start, start)) return -1; in PySlice_GetIndicesEx()
161 if (*start < 0) *start += length; in PySlice_GetIndicesEx()
162 if (*start < 0) *start = (*step < 0) ? -1 : 0; in PySlice_GetIndicesEx()
163 if (*start >= length) in PySlice_GetIndicesEx()
164 *start = (*step < 0) ? length - 1 : length; in PySlice_GetIndicesEx()
178 if ((*step < 0 && *stop >= *start) in PySlice_GetIndicesEx()
179 || (*step > 0 && *start >= *stop)) { in PySlice_GetIndicesEx()
183 *slicelength = (*stop-*start+1)/(*step)+1; in PySlice_GetIndicesEx()
186 *slicelength = (*stop-*start-1)/(*step)+1; in PySlice_GetIndicesEx()
195 PyObject *start, *stop, *step; in slice_new() local
197 start = stop = step = NULL; in slice_new()
202 if (!PyArg_UnpackTuple(args, "slice", 1, 3, &start, &stop, &step)) in slice_new()
205 /* This swapping of stop and start is to maintain similarity with in slice_new()
208 stop = start; in slice_new()
209 start = NULL; in slice_new()
211 return PySlice_New(start, stop, step); in slice_new()
216 slice(start, stop[, step])\n\
225 Py_DECREF(r->start); in slice_dealloc()
237 PyString_ConcatAndDel(&s, PyObject_Repr(r->start)); in slice_repr()
248 {"start", T_OBJECT, offsetof(PySliceObject, start), READONLY},
257 Py_ssize_t ilen, start, stop, step, slicelength; in slice_indices() local
265 if (PySlice_GetIndicesEx(self, ilen, &start, &stop, in slice_indices()
270 return Py_BuildValue("(nnn)", start, stop, step); in slice_indices()
274 "S.indices(len) -> (start, stop, stride)\n\
276 Assuming a sequence of length len, calculate the start and stop\n\
284 return Py_BuildValue("O(OOO)", Py_TYPE(self), self->start, self->stop, self->step); in slice_reduce()
305 if (PyObject_Cmp(v->start, w->start, &result) < 0) in slice_compare()
328 Py_VISIT(v->start); in slice_traverse()