mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
4ed3900041
commit
0ef8d921f5
7 changed files with 24 additions and 79 deletions
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue