gh-91603: Speed up isinstance/issubclass on union types (GH-91631)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This commit is contained in:
Yurii Karabas 2022-04-28 18:24:19 +03:00 committed by GitHub
parent 4ed3900041
commit 0ef8d921f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 24 additions and 79 deletions

View file

@ -905,7 +905,8 @@ are always available. They are listed here in alphabetical order.
tuples) or a :ref:`types-union` of multiple types, return ``True`` if
*object* is an instance of any of the types.
If *classinfo* is not a type or tuple of types and such tuples,
a :exc:`TypeError` exception is raised.
a :exc:`TypeError` exception is raised. :exc:`TypeError` may not be
raised for an invalid type if an earlier check succeeds.
.. versionchanged:: 3.10
*classinfo* can be a :ref:`types-union`.