Home | History | Annotate | Download | only in Objects

Lines Matching refs:it

14     seqiterobject *it;
20 it = PyObject_GC_New(seqiterobject, &PySeqIter_Type);
21 if (it == NULL)
23 it->it_index = 0;
25 it->it_seq = seq;
26 _PyObject_GC_TRACK(it);
27 return (PyObject *)it;
31 iter_dealloc(seqiterobject *it)
33 _PyObject_GC_UNTRACK(it);
34 Py_XDECREF(it->it_seq);
35 PyObject_GC_Del(it);
39 iter_traverse(seqiterobject *it, visitproc visit, void *arg)
41 Py_VISIT(it->it_seq);
48 seqiterobject *it;
53 it = (seqiterobject *)iterator;
54 seq = it->it_seq;
57 if (it->it_index == LONG_MAX) {
63 result = PySequence_GetItem(seq, it->it_index);
65 it->it_index++;
72 it->it_seq = NULL;
79 iter_len(seqiterobject *it)
83 if (it->it_seq) {
84 seqsize = PySequence_Size(it->it_seq);
87 len = seqsize - it->it_index;
94 PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
145 calliterobject *it;
146 it = PyObject_GC_New(calliterobject, &PyCallIter_Type);
147 if (it == NULL)
150 it->it_callable = callable;
152 it->it_sentinel = sentinel;
153 _PyObject_GC_TRACK(it);
154 return (PyObject *)it;
157 calliter_dealloc(calliterobject *it)
159 _PyObject_GC_UNTRACK(it);
160 Py_XDECREF(it->it_callable);
161 Py_XDECREF(it->it_sentinel);
162 PyObject_GC_Del(it);
166 calliter_traverse(calliterobject *it, visitproc visit, void *arg)
168 Py_VISIT(it->it_callable);
169 Py_VISIT(it->it_sentinel);
174 calliter_iternext(calliterobject *it)
176 if (it->it_callable != NULL) {
181 result = PyObject_Call(it->it_callable, args, NULL);
186 it->it_sentinel,
192 Py_CLEAR(it->it_callable);
193 Py_CLEAR(it->it_sentinel);
198 Py_CLEAR(it->it_callable);
199 Py_CLEAR(it->it_sentinel);