Mercurial > cpython-lru_cache-weakref
diff Python/errors.c @ 48876:d01c1d768841 legacy-trunk
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.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Tue, 26 Aug 2008 22:42:08 +0000 |
| parents | 0fbddc04aee1 |
| children | 3889d9528601 7e86fa255fc2 |
line wrap: on
line diff
--- a/Python/errors.c Tue Aug 26 17:08:40 2008 +0000 +++ b/Python/errors.c Tue Aug 26 22:42:08 2008 +0000 @@ -113,7 +113,6 @@ /* This function must not fail, so print the error here */ if (res == -1) { PyErr_WriteUnraisable(err); - /* issubclass did not succeed */ res = 0; } PyErr_Restore(exception, value, tb);
