◐ Shell
clean mode source ↗

bpo-43224: Implement substitution of unpacked TypeVarTuple by serhiy-storchaka · Pull Request #31800 · python/cpython

I'm not sure it's sufficient to only check for the case where len(self.__parameters__) == 1 - we could have e.g.:

T1 = TypeVar('T1')
T2 = TypeVar('T2')
Ts = TypeVarTuple('Ts')
class A(Generic[T1, T2, Unpack[Ts]]): pass
B = A[int, T2, Unpack[Ts]]
C = B[str, float]
print(C)

There, B.__parameters__ is (T2, Ts), causing a TypeError later on in the code.