summaryrefslogtreecommitdiffstats
path: root/Objects/object.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/object.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/object.c')
-rw-r--r--Objects/object.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index bf8056c..eb4d8f7 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1301,6 +1301,13 @@ _PyObject_GetDictPtr(PyObject *obj)
/* Generic GetAttr functions - put these in your tp_[gs]etattro slot */
PyObject *
+PyObject_GenericGetIter(PyObject *obj)
+{
+ Py_INCREF(obj);
+ return obj;
+}
+
+PyObject *
PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
{
PyTypeObject *tp = obj->ob_type;