Variadic *args
where args: Union[Tuple[...], Tuple[...], ...]
are _never_ checked [False Negative]
#17161
Labels
bug
mypy got something wrong
Bug Report
When
args
is aUnion
of two or more fixed-lengthTuple
s, andsome_func()
is callable, the following call is always accepted without error (regardless of what's in the tuples!):To Reproduce
[mypy-play.net]
Expected Behavior
Mypy should notice that one or more of the
Tuple
s that make up theUnion
are not appropriate for the callable, and complain about the argument types accordingly.Put another way, mypy should examine each possibility posed by the
Union
in turn, and complain if any of them isn't suitable for the variadic call.Actual Behavior
Mypy always accepts variadic arguments of this form, without any regard to the contents of the
Tuple
s that make up theUnion
.Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: