I have a Python function that retrieves the first element of an arbitrary number of *args:
def get_first(*args):
return (a[0] for a in args)
Lets say that I call this function as follows:
b = (1, 2, 3)
c = ("a", "b", "c", "d")
x = get_first(b, c)
I expect the type Tuple[int, str]
. To me it seems impossible to achieve the correct typing to accurately reveal this type.
I have had no luck with the TypeVarTuple
PEP 646 or with the Paramspec
PEP 612.