summaryrefslogtreecommitdiffstats
path: root/Objects/iterobject.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-04-04 22:04:20 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-04-04 22:04:20 (GMT)
commita701388de1135241b5a8e4c970e06c0e83a66dc0 (patch)
tree5faf9071aa6fd65c55424f1e5851bce8634a1bb7 /Objects/iterobject.c
parentd4dc6dc9e7e1fc1708c243b308a27e2faf59a3ea (diff)
downloadcpython-a701388de1135241b5a8e4c970e06c0e83a66dc0.zip
cpython-a701388de1135241b5a8e4c970e06c0e83a66dc0.tar.gz
cpython-a701388de1135241b5a8e4c970e06c0e83a66dc0.tar.bz2
Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in the stable ABI.
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r--Objects/iterobject.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index bd0544c..3cfbeaf 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -2,19 +2,6 @@
#include "Python.h"
-/* Convenience function to get builtins.iter or builtins.reversed */
-PyObject *
-_PyIter_GetBuiltin(const char *iter)
-{
- PyObject *mod, *attr;
- mod = PyImport_ImportModule("builtins");
- if (mod == NULL)
- return NULL;
- attr = PyObject_GetAttrString(mod, iter);
- Py_DECREF(mod);
- return attr;
-}
-
typedef struct {
PyObject_HEAD
long it_index;
@@ -105,10 +92,10 @@ static PyObject *
iter_reduce(seqiterobject *it)
{
if (it->it_seq != NULL)
- return Py_BuildValue("N(O)n", _PyIter_GetBuiltin("iter"),
+ return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
else
- return Py_BuildValue("N(())", _PyIter_GetBuiltin("iter"));
+ return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
}
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
@@ -242,10 +229,10 @@ static PyObject *
calliter_reduce(calliterobject *it)
{
if (it->it_callable != NULL && it->it_sentinel != NULL)
- return Py_BuildValue("N(OO)", _PyIter_GetBuiltin("iter"),
+ return Py_BuildValue("N(OO)", _PyObject_GetBuiltin("iter"),
it->it_callable, it->it_sentinel);
else
- return Py_BuildValue("N(())", _PyIter_GetBuiltin("iter"));
+ return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
}
static PyMethodDef calliter_methods[] = {