-
-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3.10] bpo-38908: [docs] Add changes to 3.10 whatsnew and fix some mi…
…nor inaccuracies in news (GH-26096) (GH-26337) The fix only applies to ``isinstance``. ``issubclass`` isn't affected (because it was always working to begin with). So I also fixed the news to reflect that. (cherry picked from commit 8450e8a) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
- Loading branch information
1 parent
4431922
commit 09696a3
Showing
2 changed files
with
12 additions
and
4 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
8 changes: 4 additions & 4 deletions
8
Misc/NEWS.d/next/Library/2021-05-12-16-43-21.bpo-38908.nM2_rO.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Fix issue where :mod:`typing` protocols without the ``@runtime_checkable`` | ||
decorator did not raise a ``TypeError`` when used with ``issubclass`` and | ||
``isinstance``. Now, subclassses of ``typing.Protocol`` will raise a | ||
``TypeError`` when used with with those checks. | ||
Subclasses of ``typing.Protocol`` which only have data variables declared | ||
will now raise a ``TypeError`` when checked with ``isinstance`` unless they | ||
are decorated with :func:`runtime_checkable`. Previously, these checks | ||
passed silently. | ||
Patch provided by Yurii Karabas. |