]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-88965: typing: fix type substitution of a list of types after initial `ParamSpec...
authorNikita Sobolev <mail@sobolevn.me>
Thu, 23 Mar 2023 16:26:11 +0000 (19:26 +0300)
committerGitHub <noreply@github.com>
Thu, 23 Mar 2023 16:26:11 +0000 (16:26 +0000)
commitadb0621652f489033b9db8d3949564c9fe545c1d
tree6c169a84fec9159498968942587fba1a338dcd26
parentbaf4eb083c09b323cc12b8636c28c14089b87de8
gh-88965: typing: fix type substitution of a list of types  after initial `ParamSpec` substitution (#102808)

Previously, this used to fail:

```py
from typing import *
T = TypeVar("T")
P = ParamSpec("P")

class X(Generic[P]):
    f: Callable[P, int]

Y = X[[int, T]]
Z = Y[str]
```

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/test/test_typing.py
Lib/typing.py
Misc/NEWS.d/next/Library/2023-03-18-14-59-21.gh-issue-88965.kA70Km.rst [new file with mode: 0644]