]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-88965: typing: fix type substitution of a list of types after initial `ParamSpec...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 23 Mar 2023 16:54:07 +0000 (09:54 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Mar 2023 16:54:07 +0000 (09:54 -0700)
commit1645a40b5eb59e7021c93fd6593d1a316d3e26e8
tree70ff1882d9af12bb5c7eac6312be52a68f8cb8c8
parent84ae50c9146e98be28cf3af4606f0ebad07807aa
gh-88965: typing: fix type substitution of a list of types  after initial `ParamSpec` substitution (GH-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]
```

(cherry picked from commit adb0621652f489033b9db8d3949564c9fe545c1d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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]