summaryrefslogtreecommitdiffstats
path: root/Include/abstract.h
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-08-26 22:40:48 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-08-26 22:40:48 (GMT)
commitec569b794737be248671d0dfac11b664fc930eef (patch)
tree76d3b98a51063f9f922a15cbe36ca58a7f0892da /Include/abstract.h
parente2dffc0aeb6e03d8e6512a13cb3fe05562f7c655 (diff)
downloadcpython-ec569b794737be248671d0dfac11b664fc930eef.zip
cpython-ec569b794737be248671d0dfac11b664fc930eef.tar.gz
cpython-ec569b794737be248671d0dfac11b664fc930eef.tar.bz2
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.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r--Include/abstract.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index 46a6f54..0bbcee5 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