]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44098: Drop ParamSpec from most ``__parameters__`` in typing generics (GH-26013)
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Thu, 13 May 2021 05:24:35 +0000 (13:24 +0800)
committerGitHub <noreply@github.com>
Thu, 13 May 2021 05:24:35 +0000 (22:24 -0700)
commitb2f3f8e3d81b0bb0ba18f563d82c28ba133c0790
tree53a693312609230211261241053263ac3e5fefcc
parent7565586724692e2ad164d770af9675f7a261fe3a
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
Lib/test/test_typing.py
Lib/typing.py
Misc/NEWS.d/next/Library/2021-05-10-17-45-00.bpo-44098._MoxuZ.rst [new file with mode: 0644]