Bug Report
mypy falsely(?) reports a type error when the *args syntax is used more than once in a function call.
To Reproduce
mypy --no-incremental --config /dev/null -c '
def foobar(a: int, b: str, c: int) -> None:
...
foo = (1,)
bar = ("b", 3)
foobar(*foo, *bar)
'
Expected Behavior
Success: no issues found in 1 source file
Actual Behavior
<string>:9: error: Argument 2 to "foobar" has incompatible type "*Tuple[str, int]"; expected "str"
<string>:9: error: Argument 2 to "foobar" has incompatible type "*Tuple[str, int]"; expected "int"
This error goes away if I:
- make
foo an int instead of Tuple[int], and remove the splat when foobar() is called.
- make
bar two ints and make foobar() take three int arguments.
- make
foo a Tuple[str, int] and make foobar() take str, int, str, int arguments.
- make
bar just a Tuple[str] and make foobar() take int, str arguments.
Your Environment
This occurs with the standard version of mypy in Debian Testing:
$ /usr/bin/mypy --version
mypy 0.812
...as well as with the latest git revision:
$ ~/.local/pipx/venvs/mypy/bin/mypy --version
mypy 0.820+dev.8642b351cff94c471333256f9cd6867807384f01
In both cases, I'm using the Debian-provided Python 3.9.2,
on up-to-date Debian Testing.
Bug Report
mypy falsely(?) reports a type error when the
*argssyntax is used more than once in a function call.To Reproduce
Expected Behavior
Actual Behavior
This error goes away if I:
fooanintinstead ofTuple[int], and remove the splat whenfoobar()is called.bartwo ints and makefoobar()take three int arguments.fooaTuple[str, int]and makefoobar()takestr, int, str, intarguments.barjust aTuple[str]and makefoobar()takeint, strarguments.Your Environment
This occurs with the standard version of mypy in Debian Testing:
...as well as with the latest git revision:
In both cases, I'm using the Debian-provided Python 3.9.2,
on up-to-date Debian Testing.