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 == PY_SSIZE_T_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 if (_PyObject_HasLen(it->it_seq)) {
85 seqsize = PySequence_Size(it->it_seq);
92 len = seqsize - it->it_index;
99 PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
102 iter_reduce(seqiterobject *it)
104 if (it->it_seq != NULL)
106 it->it_seq, it->it_index);
114 iter_setstate(seqiterobject *it, PyObject *state)
119 if (it->it_seq != NULL) {
122 it->it_index = index;
180 calliterobject *it;
181 it = PyObject_GC_New(calliterobject, &PyCallIter_Type);
182 if (it == NULL)
185 it->it_callable = callable;
187 it->it_sentinel = sentinel;
188 _PyObject_GC_TRACK(it);
189 return (PyObject *)it;
192 calliter_dealloc(calliterobject *it)
194 _PyObject_GC_UNTRACK(it);
195 Py_XDECREF(it->it_callable);
196 Py_XDECREF(it->it_sentinel);
197 PyObject_GC_Del(it);
201 calliter_traverse(calliterobject *it, visitproc visit, void *arg)
203 Py_VISIT(it->it_callable);
204 Py_VISIT(it->it_sentinel);
209 calliter_iternext(calliterobject *it)
213 if (it->it_callable == NULL) {
217 result = _PyObject_CallNoArg(it->it_callable);
221 ok = PyObject_RichCompareBool(it->it_sentinel, result, Py_EQ);
228 Py_CLEAR(it->it_callable);
229 Py_CLEAR(it->it_sentinel);
234 Py_CLEAR(it->it_callable);
235 Py_CLEAR(it->it_sentinel);
241 calliter_reduce(calliterobject *it)
243 if (it->it_callable != NULL && it->it_sentinel != NULL)
245 it->it_callable, it->it_sentinel);