diff options
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r-- | Objects/iterobject.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c index ada1bdc..5bee1e2 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -104,11 +104,12 @@ PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list( static PyObject * iter_reduce(seqiterobject *it, PyObject *Py_UNUSED(ignored)) { + _Py_IDENTIFIER(iter); if (it->it_seq != NULL) - return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"), + return Py_BuildValue("N(O)n", _PyEval_GetBuiltinId(&PyId_iter), it->it_seq, it->it_index); else - return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter")); + return Py_BuildValue("N(())", _PyEval_GetBuiltinId(&PyId_iter)); } PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); @@ -243,11 +244,12 @@ calliter_iternext(calliterobject *it) static PyObject * calliter_reduce(calliterobject *it, PyObject *Py_UNUSED(ignored)) { + _Py_IDENTIFIER(iter); if (it->it_callable != NULL && it->it_sentinel != NULL) - return Py_BuildValue("N(OO)", _PyObject_GetBuiltin("iter"), + return Py_BuildValue("N(OO)", _PyEval_GetBuiltinId(&PyId_iter), it->it_callable, it->it_sentinel); else - return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter")); + return Py_BuildValue("N(())", _PyEval_GetBuiltinId(&PyId_iter)); } static PyMethodDef calliter_methods[] = { |