Home | History | Annotate | Download | only in Objects

Lines Matching refs:start

56    start, stop, and step are python objects with None indicating no

61 PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
70 if (start == NULL) start = Py_None;
71 Py_INCREF(start);
76 obj->start = start;
85 PyObject *start, *end, *slice;
86 start = PyInt_FromSsize_t(istart);
87 if (!start)
91 Py_DECREF(start);
95 slice = PySlice_New(start, end, NULL);
96 Py_DECREF(start);
103 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
112 if (r->start == Py_None) {
113 *start = *step < 0 ? length-1 : 0;
115 if (!PyInt_Check(r->start) && !PyLong_Check(r->step)) return -1;
116 *start = PyInt_AsSsize_t(r->start);
117 if (*start < 0) *start += length;
127 if (*start >= length) return -1;
134 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength)
155 if (r->start == Py_None) {
156 *start = defstart;
159 if (!_PyEval_SliceIndex(r->start, start)) return -1;
160 if (*start < 0) *start += length;
161 if (*start < 0) *start = (*step < 0) ? -1 : 0;
162 if (*start >= length)
163 *start = (*step < 0) ? length - 1 : length;
177 if ((*step < 0 && *stop >= *start)
178 || (*step > 0 && *start >= *stop)) {
182 *slicelength = (*stop-*start+1)/(*step)+1;
185 *slicelength = (*stop-*start-1)/(*step)+1;
194 PyObject *start, *stop, *step;
196 start = stop = step = NULL;
201 if (!PyArg_UnpackTuple(args, "slice", 1, 3, &start, &stop, &step))
204 /* This swapping of stop and start is to maintain similarity with
207 stop = start;
208 start = NULL;
210 return PySlice_New(start, stop, step);
214 "slice([start,] stop[, step])\n\
222 Py_DECREF(r->start);
234 PyString_ConcatAndDel(&s, PyObject_Repr(r->start));
245 {"start", T_OBJECT, offsetof(PySliceObject, start), READONLY},
254 Py_ssize_t ilen, start, stop, step, slicelength;
262 if (PySlice_GetIndicesEx(self, ilen, &start, &stop,
267 return Py_BuildValue("(nnn)", start, stop, step);
271 "S.indices(len) -> (start, stop, stride)\n\
273 Assuming a sequence of length len, calculate the start and stop\n\
281 return Py_BuildValue("O(OOO)", Py_TYPE(self), self->start, self->stop, self->step);
302 if (PyObject_Cmp(v->start, w->start, &result) < 0)