From: Benjamin Peterson Date: Fri, 8 May 2009 03:06:00 +0000 (+0000) Subject: add _PyObject_LookupSpecial to handle fetching special method lookup X-Git-Tag: v2.7a1~1246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=399e4c4f8f2570a342ac50e9500b12e86eb330a9;p=python add _PyObject_LookupSpecial to handle fetching special method lookup --- diff --git a/Include/object.h b/Include/object.h index 1bc13e7c2a..12e0c46ed6 100644 --- a/Include/object.h +++ b/Include/object.h @@ -451,6 +451,7 @@ PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t); PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **); PyAPI_FUNC(unsigned int) PyType_ClearCache(void); PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ae22af7ffc..46fb581e4a 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1665,6 +1665,58 @@ order (MRO) for bases """ self.assertEqual(E().foo, C.foo) # i.e., unbound self.assert_(repr(C.foo.__get__(C(1))).startswith("