diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2021-05-24 23:51:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 23:51:08 (GMT) |
commit | 8450e8a81f6d54f45e1fc5c13a03878c9978750d (patch) | |
tree | 200f7bf87226aedd103e3a35a782b54c413e1f58 /Doc | |
parent | 563bd5a4dcc6a26e47966cb66db64859902bce76 (diff) | |
download | cpython-8450e8a81f6d54f45e1fc5c13a03878c9978750d.zip cpython-8450e8a81f6d54f45e1fc5c13a03878c9978750d.tar.gz cpython-8450e8a81f6d54f45e1fc5c13a03878c9978750d.tar.bz2 |
bpo-38908: [docs] Add changes to 3.10 whatsnew and fix some minor inaccuracies in news (GH-26096)
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.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.10.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 6443b78..a006eb4 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1317,6 +1317,14 @@ Add new function :func:`typing.is_typeddict` to introspect if an annotation is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:`41792`) +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. Users should decorate their +subclasses with the :func:`runtime_checkable` decorator +if they want runtime protocols. +(Contributed by Yurii Karabas in :issue:`38908`) + unittest -------- |