Oct. 19, 2020
5:42 p.m.
Has there been any thought given to a way to "collapse" a ListVariadic into a single type? This would be useful, for example, in the declaration of the built-in `tuple` class. It accepts a variadic TypeVar, but its base class `Sequence` does not. The type argument for `Sequence` needs to be the union of the types in the tuple's ListVariadic. The reason I ask is that the pyright code contains a bunch of special-case handling for tuples because they are currently the only type that allows variadic TypeVars. It would be great to replace all of this special-case logic with generalized support for variadic generics. The current proposal comes close to enabling this. -Eric -- Eric Traut Contributor to pyright & pylance Microsoft Corp.