forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-88965: typing: fix type substitution of a list of types afte…
…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 <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
- Loading branch information
1 parent
84ae50c
commit 1645a40
Showing
3 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Misc/NEWS.d/next/Library/2023-03-18-14-59-21.gh-issue-88965.kA70Km.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
typing: Fix a bug relating to substitution in custom classes generic over a | ||
:class:`~typing.ParamSpec`. Previously, if the ``ParamSpec`` was substituted | ||
with a parameters list that itself contained a :class:`~typing.TypeVar`, the | ||
``TypeVar`` in the parameters list could not be subsequently substituted. This | ||
is now fixed. | ||
|
||
Patch by Nikita Sobolev. |