diff options
| author | Raymond Hettinger <python@rcn.com> | 2003-03-17 08:24:35 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2003-03-17 08:24:35 +0000 |
| commit | 01538269643175877f516d09f429a2ae28136da6 (patch) | |
| tree | 3b6bdbf815394deaf883b1409de3520de88959b4 /Objects/object.c | |
| parent | 08801db123077407ae7ec7af2fe2d65a24a46063 (diff) | |
| download | cpython-git-01538269643175877f516d09f429a2ae28136da6.tar.gz | |
Created PyObject_GenericGetIter().
Factors out the common case of returning self.
Diffstat (limited to 'Objects/object.c')
| -rw-r--r-- | Objects/object.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index bf8056c655..eb4d8f7cfb 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; |
