summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-03-17 08:24:35 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-03-17 08:24:35 (GMT)
commit01538269643175877f516d09f429a2ae28136da6 (patch)
tree3b6bdbf815394deaf883b1409de3520de88959b4 /Objects/tupleobject.c
parent08801db123077407ae7ec7af2fe2d65a24a46063 (diff)
downloadcpython-01538269643175877f516d09f429a2ae28136da6.zip
cpython-01538269643175877f516d09f429a2ae28136da6.tar.gz
cpython-01538269643175877f516d09f429a2ae28136da6.tar.bz2
Created PyObject_GenericGetIter().
Factors out the common case of returning self.
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index d6d0aaa..ede18e0 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -779,14 +779,6 @@ tupleiter_traverse(tupleiterobject *it, visitproc visit, void *arg)
return visit((PyObject *)it->it_seq, arg);
}
-
-static PyObject *
-tupleiter_getiter(PyObject *it)
-{
- Py_INCREF(it);
- return it;
-}
-
static PyObject *
tupleiter_next(tupleiterobject *it)
{
@@ -839,6 +831,6 @@ PyTypeObject PyTupleIter_Type = {
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- (getiterfunc)tupleiter_getiter, /* tp_iter */
+ PyObject_GenericGetIter, /* tp_iter */
(iternextfunc)tupleiter_next, /* tp_iternext */
};