diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-26 22:42:08 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-26 22:42:08 (GMT) |
commit | 0668c62677e76b2acf7e4d11d5e9c1f4420a54f1 (patch) | |
tree | 0d6001ed47c5e6f715996eb2fc7e512d8c7a2de7 /Include/abstract.h | |
parent | 14cb6bcf2ba953735ec1ef622f8ff8e23db1f326 (diff) | |
download | cpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.zip cpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.tar.gz cpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 04c007a..f3bc8bc 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -1377,6 +1377,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 |