summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next
diff options
context:
space:
mode:
authorIvan Levkivskyi <levkivskyi@gmail.com>2019-05-28 07:40:15 (GMT)
committerGitHub <noreply@github.com>2019-05-28 07:40:15 (GMT)
commit74d7f76e2c953fbfdb7ce01b7319d91d471cc5ef (patch)
tree6bba7b64dc4b4a88569809f0758113c87bb690b4 /Misc/NEWS.d/next
parent3880f263d2994fb1eba25835dddccb0cf696fdf0 (diff)
downloadcpython-74d7f76e2c953fbfdb7ce01b7319d91d471cc5ef.zip
cpython-74d7f76e2c953fbfdb7ce01b7319d91d471cc5ef.tar.gz
cpython-74d7f76e2c953fbfdb7ce01b7319d91d471cc5ef.tar.bz2
bpo-37058: PEP 544: Add Protocol to typing module (GH-13585)
I tried to get rid of the `_ProtocolMeta`, but unfortunately it didn'y work. My idea to return a generic alias from `@runtime_checkable` made runtime protocols unpickleable. I am not sure what is worse (a custom metaclass or having some classes unpickleable), so I decided to stick with the status quo (since there were no complains so far). So essentially this is a copy of the implementation in `typing_extensions` with two modifications: * Rename `@runtime` to `@runtime_checkable` (plus corresponding updates). * Allow protocols that extend `collections.abc.Iterable` etc.
Diffstat (limited to 'Misc/NEWS.d/next')
-rw-r--r--Misc/NEWS.d/next/Library/2019-05-26-19-05-24.bpo-37058.jmRu_g.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-05-26-19-05-24.bpo-37058.jmRu_g.rst b/Misc/NEWS.d/next/Library/2019-05-26-19-05-24.bpo-37058.jmRu_g.rst
new file mode 100644
index 0000000..329b82c
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-05-26-19-05-24.bpo-37058.jmRu_g.rst
@@ -0,0 +1 @@
+PEP 544: Add ``Protocol`` and ``@runtime_checkable`` to the ``typing`` module. \ No newline at end of file