Lines Matching refs:start

18     PyObject *start;
45 compute_range_length(PyObject *start, PyObject *stop, PyObject *step);
48 make_range_object(PyTypeObject *type, PyObject *start,
53 length = compute_range_length(start, stop, step);
62 obj->start = start;
78 PyObject *start = NULL, *stop = NULL, *step = NULL;
86 start = PyNumber_Index(args[0]);
87 if (!start) {
92 Py_DECREF(start);
97 Py_DECREF(start);
107 start = _PyLong_GetZero();
108 Py_INCREF(start);
122 obj = make_range_object(type, start, stop, step);
128 Py_DECREF(start);
157 range(start, stop[, step]) -> range object\n\
159 Return an object that produces a sequence of integers from start (inclusive)\n\
161 start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\n\
168 Py_DECREF(r->start);
180 compute_range_length(PyObject *start, PyObject *stop, PyObject *step)
200 lo = start;
205 hi = start;
259 * return r->start + (i * r->step)
262 result = PyNumber_Add(r->start, i);
269 result = PyNumber_Add(r->start, incr);
345 PyObject *start = NULL, *stop = NULL, *step = NULL;
349 error = _PySlice_GetLongIndices(slice, r->length, &start, &stop, &step);
357 substart = compute_item(r, start);
359 Py_CLEAR(start);
370 Py_XDECREF(start);
394 if (cmp1 == 1) { /* positive steps: start <= ob < stop */
395 cmp2 = PyObject_RichCompareBool(r->start, ob, Py_LE);
398 else { /* negative steps: stop < ob <= start */
399 cmp2 = PyObject_RichCompareBool(ob, r->start, Py_LE);
411 tmp1 = PyNumber_Subtract(ob, r->start);
417 /* result = ((int(ob) - start) % step) == 0 */
444 if r0.start != r1.start:
465 cmp_result = PyObject_RichCompareBool(r0->start, r1->start, Py_EQ);
511 return hash((len(r), r.start, None))
512 return hash((len(r), r.start, r.step))
536 Py_INCREF(r->start);
537 PyTuple_SET_ITEM(t, 1, r->start);
591 PyObject *idx = PyNumber_Subtract(ob, r->start);
600 /* idx = (ob - r.start) // r.step */
636 return PyUnicode_FromFormat("range(%R, %R)", r->start, r->stop);
639 r->start, r->stop, r->step);
647 r->start, r->stop, r->step);
710 {"start", T_OBJECT_EX, offsetof(rangeobject, start), READONLY},
768 long start;
779 return PyLong_FromLong((long)(r->start +
796 PyObject *start=NULL, *stop=NULL, *step=NULL;
800 start = PyLong_FromLong(r->start);
801 if (start == NULL)
803 stop = PyLong_FromLong(r->start + r->len * r->step);
810 start, stop, step);
817 Py_XDECREF(start);
916 fast_range_iter(long start, long stop, long step, long len)
921 it->start = start;
931 PyObject *start;
952 stop = PyNumber_Add(r->start, product);
956 Py_INCREF(r->start);
959 r->start, stop, r->step);
961 Py_DECREF(r->start);
1011 Py_XDECREF(r->start);
1034 result = PyNumber_Add(r->start, product);
1091 lstart = PyLong_AsLong(r->start);
1128 it->start = r->start;
1132 Py_INCREF(it->start);
1150 /* reversed(range(start, stop, step)) can be expressed as
1151 range(start+(n-1)*step, start-step, -step), where n is the number of
1154 If each of start, stop, step, -step, start-step, and the length
1160 lstart = PyLong_AsLong(range->start);
1213 it->index = it->start = it->step = NULL;
1215 /* start + (len - 1) * step */
1228 sum = PyNumber_Add(range->start, product);
1230 it->start = sum;
1231 if (!it->start)