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;
58 result = PySequence_GetItem(seq, it->it_index);
60 it->it_index++;
68 it->it_seq = NULL;
74 iter_len(seqiterobject *it)
78 if (it->it_seq) {
79 seqsize = PySequence_Size(it->it_seq);
82 len = seqsize - it->it_index;
89 PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
140 calliterobject *it;
141 it = PyObject_GC_New(calliterobject, &PyCallIter_Type);
142 if (it == NULL)
145 it->it_callable = callable;
147 it->it_sentinel = sentinel;
148 _PyObject_GC_TRACK(it);
149 return (PyObject *)it;
152 calliter_dealloc(calliterobject *it)
154 _PyObject_GC_UNTRACK(it);
155 Py_XDECREF(it->it_callable);
156 Py_XDECREF(it->it_sentinel);
157 PyObject_GC_Del(it);
161 calliter_traverse(calliterobject *it, visitproc visit, void *arg)
163 Py_VISIT(it->it_callable);
164 Py_VISIT(it->it_sentinel);
169 calliter_iternext(calliterobject *it)
171 if (it->it_callable != NULL) {
176 result = PyObject_Call(it->it_callable, args, NULL);
181 it->it_sentinel,
187 Py_CLEAR(it->it_callable);
188 Py_CLEAR(it->it_sentinel);
193 Py_CLEAR(it->it_callable);
194 Py_CLEAR(it->it_sentinel);