Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
Right now there's an uncovered branch inTypeVarTuple.__typing_prepare_subst__
:
And it looks like there's a bug in it,these two lines:
forparaminenumerate(params[typevartuple_index+1:]):ifisinstance(param,TypeVarTuple):
Thisif
's body will never be executed, becauseenumerate
always returnstuple[int, T]
, it is neverTypeVarTuple
.
So, I think that we need to removeenumerate()
call here and add a test like:
>>>fromtypingimportGeneric,TypeVarTuple>>>V=TypeVarTuple('V')>>>T=TypeVarTuple('T')>>>classMy(Generic[*T]):pass...>>>My[*T,*V][*V]TypeError:MorethanoneTypeVarTupleparameterin__main__.My[*T,*V]
I will send a PR 😉