diff Objects/typeobject.c @ 53904:1ecdca11eb9e legacy-trunk

add _PyObject_LookupSpecial to handle fetching special method lookup
author Benjamin Peterson <benjamin@python.org>
date Fri, 08 May 2009 03:06:00 +0000
parents 318951890abb
children b7920e183422
line wrap: on
line diff
--- a/Objects/typeobject.c	Fri May 08 02:28:39 2009 +0000
+++ b/Objects/typeobject.c	Fri May 08 03:06:00 2009 +0000
@@ -1179,6 +1179,8 @@
      when the _PyType_Lookup() call fails;
 
    - lookup_method() always raises an exception upon errors.
+
+   - _PyObject_LookupSpecial() exported for the benefit of other places.
 */
 
 static PyObject *
@@ -1211,6 +1213,12 @@
 	return res;
 }
 
+PyObject *
+_PyObject_LookupSpecial(PyObject *self, char *attrstr, PyObject **attrobj)
+{
+	return lookup_maybe(self, attrstr, attrobj);
+}
+
 /* A variation of PyObject_CallMethod that uses lookup_method()
    instead of PyObject_GetAttrString().	 This uses the same convention
    as lookup_method to cache the interned name string object. */