mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-96385: Correctly raise error on [*T, *V]
substitution (GH-96386) (#96407)
(cherry picked from commit 75177358a6
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
8e2d347183
commit
16d8948c31
3 changed files with 7 additions and 1 deletions
|
@ -1071,7 +1071,7 @@ class TypeVarTuple(_Final, _Immutable, _PickleUsingNameMixin, _root=True):
|
|||
def __typing_prepare_subst__(self, alias, args):
|
||||
params = alias.__parameters__
|
||||
typevartuple_index = params.index(self)
|
||||
for param in enumerate(params[typevartuple_index + 1:]):
|
||||
for param in params[typevartuple_index + 1:]:
|
||||
if isinstance(param, TypeVarTuple):
|
||||
raise TypeError(f"More than one TypeVarTuple parameter in {alias}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue