diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-05-31 08:46:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-31 08:46:16 +0300 |
commit | f545fc955aeb701ae4e73b07ff2283f823d857b8 (patch) | |
tree | 5faff1c7a7f2bc34aedf6b6a352f5cd3cdbf7ea7 /Lib/test/test_typing.py | |
parent | 5893b5db98b38b17750c0572c7209774a5034898 (diff) | |
download | cpython-f545fc955aeb701ae4e73b07ff2283f823d857b8.tar.gz cpython-f545fc955aeb701ae4e73b07ff2283f823d857b8.zip |
gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)
For example: tuple[*Ts, list[T]][int, str, bool]
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 2afac235391..d6cd3d9bdd6 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -768,12 +768,18 @@ class GenericAliasSubstitutionTests(BaseTestCase): ('generic[T, *Ts]', '[int]', 'generic[int]'), ('generic[T, *Ts]', '[int, str]', 'generic[int, str]'), ('generic[T, *Ts]', '[int, str, bool]', 'generic[int, str, bool]'), + ('generic[list[T], *Ts]', '[int]', 'generic[list[int]]'), + ('generic[list[T], *Ts]', '[int, str]', 'generic[list[int], str]'), + ('generic[list[T], *Ts]', '[int, str, bool]', 'generic[list[int], str, bool]'), ('generic[T, *Ts]', '[*tuple[int, ...]]', 'TypeError'), # Should be generic[int, *tuple[int, ...]] ('generic[*Ts, T]', '[int]', 'generic[int]'), ('generic[*Ts, T]', '[int, str]', 'generic[int, str]'), - ('generic[*Ts, T]', '[int, str, bool]', 'generic[int, str, bool]'), + ('generic[*Ts, T]', '[int, str, bool]', 'generic[int, str, bool]'), + ('generic[*Ts, list[T]]', '[int]', 'generic[list[int]]'), + ('generic[*Ts, list[T]]', '[int, str]', 'generic[int, list[str]]'), + ('generic[*Ts, list[T]]', '[int, str, bool]', 'generic[int, str, list[bool]]'), ('generic[T, *tuple_type[int, ...]]', '[str]', 'generic[str, *tuple_type[int, ...]]'), ('generic[T1, T2, *tuple_type[int, ...]]', '[str, bool]', 'generic[str, bool, *tuple_type[int, ...]]'), |