]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 26 Aug 2008 22:42:08 +0000 (22:42 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 26 Aug 2008 22:42:08 +0000 (22:42 +0000)
commit0668c62677e76b2acf7e4d11d5e9c1f4420a54f1
tree0d6001ed47c5e6f715996eb2fc7e512d8c7a2de7
parent14cb6bcf2ba953735ec1ef622f8ff8e23db1f326
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
Lib/test/test_abc.py
Lib/test/test_exceptions.py
Lib/test/test_typechecks.py
Misc/NEWS
Objects/abstract.c
Objects/typeobject.c
Python/errors.c