[Python-checkins] python/dist/src/Include classobject.h,2.41,2.42
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Mon, 07 Apr 2003 10:52:01 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv9658/Include
Modified Files:
classobject.h
Log Message:
New private API function _PyInstance_Lookup. gc will use this to figure
out whether __del__ exists, without executing any Python-level code.
Index: classobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/classobject.h,v
retrieving revision 2.41
retrieving revision 2.42
diff -C2 -d -r2.41 -r2.42
*** classobject.h 12 Aug 2002 07:21:56 -0000 2.41
--- classobject.h 7 Apr 2003 17:51:58 -0000 2.42
***************
*** 52,55 ****
--- 52,67 ----
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. */