Assuming T = TypeVar('T')
Optional[T] hint is interpreted to Union[T, None].
Is there any equivalent for Sequence hint, so that it will be interpreted to Union[T, Sequence[T]]?
@AzatIbrakov: There are some built-in functions that behave like this, so it's not that weird. See min/max (which is either one iterable argument or more than one scalar argument), or str.endswith's ability to take a single str or a tuple of str.
min/max(which is either one iterable argument or more than one scalar argument), orstr.endswith's ability to take a singlestror atupleofstr.