forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-105974: Revert unintentional behaviour change for protocols …
…with non-callable members and custom `__subclasshook__` methods (pythonGH-105976) (cherry picked from commit 9499b0f) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
- Loading branch information
1 parent
1ffcd49
commit ab4be16
Showing
3 changed files
with
79 additions
and
32 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
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
6 changes: 6 additions & 0 deletions
6
Misc/NEWS.d/next/Library/2023-06-21-19-04-27.gh-issue-105974.M47n3t.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,6 @@ | ||
Fix bug where a :class:`typing.Protocol` class that had one or more | ||
non-callable members would raise :exc:`TypeError` when :func:`issubclass` | ||
was called against it, even if it defined a custom ``__subclasshook__`` | ||
method. The behaviour in Python 3.11 and lower -- which has now been | ||
restored -- was not to raise :exc:`TypeError` in these situations if a | ||
custom ``__subclasshook__`` method was defined. Patch by Alex Waygood. |