]> granicus.if.org Git - python/commit
Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 26 Aug 2008 22:40:48 +0000 (22:40 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 26 Aug 2008 22:40:48 +0000 (22:40 +0000)
commitec569b794737be248671d0dfac11b664fc930eef
tree76d3b98a51063f9f922a15cbe36ca58a7f0892da
parente2dffc0aeb6e03d8e6512a13cb3fe05562f7c655
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