From 399e4c4f8f2570a342ac50e9500b12e86eb330a9 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 8 May 2009 03:06:00 +0000 Subject: add _PyObject_LookupSpecial to handle fetching special method lookup --- Include/object.h | 1 + Lib/test/test_descr.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ Objects/object.c | 15 +++------------ Objects/typeobject.c | 8 ++++++++ 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/Include/object.h b/Include/object.h index 1bc13e7..12e0c46 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 ae22af7..46fb581 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("