diff options
author | Raymond Hettinger <python@rcn.com> | 2003-03-17 08:35:49 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-03-17 08:35:49 (GMT) |
commit | e0cce8f8f00bf2c070cb1f564d950d62530df377 (patch) | |
tree | 32e33182bb5b59df8f581878cf1b61aa4756aea2 /Modules/xreadlinesmodule.c | |
parent | 01538269643175877f516d09f429a2ae28136da6 (diff) | |
download | cpython-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/xreadlinesmodule.c')
-rw-r--r-- | Modules/xreadlinesmodule.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/xreadlinesmodule.c b/Modules/xreadlinesmodule.c index bf3c091..b0715f6 100644 --- a/Modules/xreadlinesmodule.c +++ b/Modules/xreadlinesmodule.c @@ -82,13 +82,6 @@ xreadlines_item(PyXReadlinesObject *a, int i) } static PyObject * -xreadlines_getiter(PyXReadlinesObject *a) -{ - Py_INCREF(a); - return (PyObject *)a; -} - -static PyObject * xreadlines_iternext(PyXReadlinesObject *a) { PyObject *res; @@ -159,7 +152,7 @@ static PyTypeObject XReadlinesObject_Type = { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - (getiterfunc)xreadlines_getiter, /* tp_iter */ + PyObject_GenericGetIter, /* tp_iter */ (iternextfunc)xreadlines_iternext, /* tp_iternext */ }; |