Lines Matching defs:index
57 * 0 <= index < BLOCKLEN
902 PyObject *index = _PyNumber_Index(args[0]);
903 if (index == NULL) {
906 n = PyLong_AsSsize_t(index);
907 Py_DECREF(index);
942 /* Advance left block/index pair */
949 /* Step backwards with the right block/index pair */
966 Py_ssize_t index = deque->leftindex;
975 item = b->data[index];
989 /* Advance left block/index pair */
990 index++;
991 if (index == BLOCKLEN) {
993 index = 0;
1006 Py_ssize_t index = deque->leftindex;
1014 item = b->data[index];
1026 index++;
1027 if (index == BLOCKLEN) {
1029 index = 0;
1047 Py_ssize_t index = deque->leftindex;
1051 if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index", &v,
1077 index++;
1078 if (index == BLOCKLEN) {
1080 index = 0;
1087 item = b->data[index];
1098 index++;
1099 if (index == BLOCKLEN) {
1101 index = 0;
1109 "D.index(value, [start, [stop]]) -- return first index of value.\n"
1123 Py_ssize_t index;
1128 if (!_PyArg_ParseStack(args, nargs, "nO:insert", &index, &value)) {
1136 if (index >= n)
1138 if (index <= -n || index == 0)
1140 if (_deque_rotate(deque, -index))
1142 if (index < 0)
1149 if (_deque_rotate(deque, index))
1155 "D.insert(index, object) -- insert object before index");
1173 Py_ssize_t n, index=i;
1176 PyErr_SetString(PyExc_IndexError, "deque index out of range");
1190 if (index < (Py_SIZE(deque) >> 1)) {
1229 Py_ssize_t i, n = Py_SIZE(deque), index = deque->leftindex;
1234 item = b->data[index];
1249 index++;
1250 if (index == BLOCKLEN) {
1252 index = 0;
1271 Py_ssize_t n, len=Py_SIZE(deque), halflen=(len+1)>>1, index=i;
1274 PyErr_SetString(PyExc_IndexError, "deque index out of range");
1283 if (index <= halflen) {
1328 Py_ssize_t index;
1333 for (index = indexlo; index < BLOCKLEN ; index++) {
1334 item = b->data[index];
1340 for (index = indexlo; index <= indexhigh; index++) {
1341 item = b->data[index];
1431 /* Search for the first index where items are different */
1591 {"index", _PyCFunction_CAST(deque_index),
1671 Py_ssize_t index;
1688 it->index = deque->leftindex;
1727 it->index > it->deque->rightindex));
1729 item = it->b->data[it->index];
1730 it->index++;
1732 if (it->index == BLOCKLEN && it->counter > 0) {
1735 it->index = 0;
1744 Py_ssize_t i, index=0;
1747 if (!PyArg_ParseTuple(args, "O!|n", &deque_type, &deque, &index))
1755 for(i=0; i<index; i++) {
1846 it->index = deque->rightindex;
1869 it->index < it->deque->leftindex));
1871 item = it->b->data[it->index];
1872 it->index--;
1874 if (it->index < 0 && it->counter > 0) {
1877 it->index = BLOCKLEN - 1;
1886 Py_ssize_t i, index=0;
1889 if (!PyArg_ParseTuple(args, "O!|n", &deque_type, &deque, &index))
1897 for(i=0; i<index; i++) {
2394 Py_ssize_t index;
2402 index: Py_ssize_t
2408 tuplegetter_new_impl(PyTypeObject *type, Py_ssize_t index, PyObject *doc)
2416 self->index = index;
2425 Py_ssize_t index = ((_tuplegetterobject*)self)->index;
2438 "descriptor for index '%zd' for tuple subclasses "
2440 index,
2445 if (!valid_index(index, PyTuple_GET_SIZE(obj))) {
2446 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
2450 result = PyTuple_GET_ITEM(obj, index);
2493 return Py_BuildValue("(O(nO))", (PyObject*) Py_TYPE(self), self->index, self->doc);
2501 self->index, self->doc);