summaryrefslogtreecommitdiff
path: root/Include/classobject.h
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-04-07 17:51:59 +0000
committerTim Peters <tim.peters@gmail.com>2003-04-07 17:51:59 +0000
commitdf875b99fcb69c18168fb761ddaa722a034175dd (patch)
treee61ba67f62a7bad46095b5a49523edf475950558 /Include/classobject.h
parentcb8ed53014ea04c2f1f340c720cb670c888df6bb (diff)
downloadcpython-git-df875b99fcb69c18168fb761ddaa722a034175dd.tar.gz
New private API function _PyInstance_Lookup. gc will use this to figure
out whether __del__ exists, without executing any Python-level code.
Diffstat (limited to 'Include/classobject.h')
-rw-r--r--Include/classobject.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Include/classobject.h b/Include/classobject.h
index b071e98f04..1328c274d5 100644
--- a/Include/classobject.h
+++ b/Include/classobject.h
@@ -51,6 +51,18 @@ PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
PyAPI_FUNC(PyObject *) PyMethod_Class(PyObject *);
+/* Look up attribute with name (a string) on instance object pinst, using
+ * only the instance and base class dicts. If a descriptor is found in
+ * a class dict, the descriptor is returned without calling it.
+ * Returns NULL if nothing found, else a borrowed reference to the
+ * value associated with name in the dict in which name was found.
+ * The point of this routine is that it never calls arbitrary Python
+ * code, so is always "safe": all it does is dict lookups. The function
+ * can't fail, never sets an exceptionm, and NULL is not an error (it just
+ * means "not found").
+ */
+PyAPI_FUNC(PyObject *)_PyInstance_Lookup(PyObject *pinst, PyObject *name);
+
/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
#define PyMethod_GET_FUNCTION(meth) \