From 5dce1f4190a2be4c5f946b101c3f9c5b63976240 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 26 Aug 2008 22:40:48 +0000 Subject: Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger. --- Include/abstract.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Include/abstract.h') diff --git a/Include/abstract.h b/Include/abstract.h index 46a6f544a3..0bbcee54d9 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -1273,6 +1273,11 @@ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass); /* issubclass(object, typeorclass) */ +PyAPI_FUNC(int) _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); + +PyAPI_FUNC(int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); + + #ifdef __cplusplus } #endif -- cgit v1.2.1