forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…nst runtime-checkable protocols by avoiding costly `super()` calls (python#112708)
- Loading branch information
1 parent
e8ff40d
commit cb075b6
Showing
2 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Misc/NEWS.d/next/Library/2023-12-04-14-05-24.gh-issue-74690.eODKRm.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Speedup :func:`isinstance` checks by roughly 20% for | ||
:func:`runtime-checkable protocols <typing.runtime_checkable>` | ||
that only have one callable member. | ||
Speedup :func:`issubclass` checks for these protocols by roughly 10%. | ||
Patch by Alex Waygood. |