summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2021-05-13 05:24:35 (GMT)
committerGitHub <noreply@github.com>2021-05-13 05:24:35 (GMT)
commitb2f3f8e3d81b0bb0ba18f563d82c28ba133c0790 (patch)
tree53a693312609230211261241053263ac3e5fefcc /Misc
parent7565586724692e2ad164d770af9675f7a261fe3a (diff)
downloadcpython-b2f3f8e3d81b0bb0ba18f563d82c28ba133c0790.zip
cpython-b2f3f8e3d81b0bb0ba18f563d82c28ba133c0790.tar.gz
cpython-b2f3f8e3d81b0bb0ba18f563d82c28ba133c0790.tar.bz2
bpo-44098: Drop ParamSpec from most ``__parameters__`` in typing generics (GH-26013)
Added two new attributes to ``_GenericAlias``: * ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks. * ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this class deals with ``ParamSpec``. Automerge-Triggered-By: GH:gvanrossum
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2021-05-10-17-45-00.bpo-44098._MoxuZ.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2021-05-10-17-45-00.bpo-44098._MoxuZ.rst b/Misc/NEWS.d/next/Library/2021-05-10-17-45-00.bpo-44098._MoxuZ.rst
new file mode 100644
index 0000000..2aaa8b6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-05-10-17-45-00.bpo-44098._MoxuZ.rst
@@ -0,0 +1,5 @@
+``typing.ParamSpec`` will no longer be found in the ``__parameters__`` of
+most :mod:`typing` generics except in valid use locations specified by
+:pep:`612`. This prevents incorrect usage like ``typing.List[P][int]``. This
+change means incorrect usage which may have passed silently in 3.10 beta 1
+and earlier will now error.