Skip to content

[3.11] gh-88965: typing: fix type substitution of a list of types after initial ParamSpec substitution (GH-102808) #102957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Mar 23, 2023

Previously, this used to fail:

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 adb0621)

Co-authored-by: Nikita Sobolev mail@sobolevn.me
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com

…r initial `ParamSpec` substitution (pythonGH-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 adb0621)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood AlexWaygood self-assigned this Mar 23, 2023
@miss-islington miss-islington merged commit 1645a40 into python:3.11 Mar 23, 2023
@miss-islington miss-islington deleted the backport-adb0621-3.11 branch March 23, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-typing type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants