summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-03-17 08:35:49 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-03-17 08:35:49 (GMT)
commite0cce8f8f00bf2c070cb1f564d950d62530df377 (patch)
tree32e33182bb5b59df8f581878cf1b61aa4756aea2 /Modules/arraymodule.c
parent01538269643175877f516d09f429a2ae28136da6 (diff)
downloadcpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.zip
cpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.tar.gz
cpython-e0cce8f8f00bf2c070cb1f564d950d62530df377.tar.bz2
Created PyObject_GenericGetIter().
Factors out the common case of returning self.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 4c1a0fb..ec44935 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1962,13 +1962,6 @@ array_iter(arrayobject *ao)
}
static PyObject *
-arrayiter_getiter(PyObject *it)
-{
- Py_INCREF(it);
- return it;
-}
-
-static PyObject *
arrayiter_next(arrayiterobject *it)
{
assert(PyArrayIter_Check(it));
@@ -2021,7 +2014,7 @@ static PyTypeObject PyArrayIter_Type = {
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- (getiterfunc)arrayiter_getiter, /* tp_iter */
+ PyObject_GenericGetIter, /* tp_iter */
(iternextfunc)arrayiter_next, /* tp_iternext */
0, /* tp_methods */
};