-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongpendingIssues that may be closedIssues that may be closed
Description
Bug Report
Mypy reports multiple values for a kwarg if args are given via splat and the kwarg is explicitly set.
To Reproduce
def foo(x: int, y: int, z: str) -> None:
print(x, y, z)
args = [1, 2]
foo(*args, z="...")Expected Behavior
Mypy should not report any problems.
Actual Behavior
mypysandbox.py:5: error: "foo" gets multiple values for keyword argument "z" [misc]
mypysandbox.py:5: error: Argument 1 to "foo" has incompatible type "*list[int]"; expected "str" [arg-type]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
$ mypy --version
mypy 1.19.1 (compiled: yes)
$ python --version
Python 3.12.12
Mypy config from pyproject.toml:
[tool.mypy]
strict = true
allow_redefinition = trueMetadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpendingIssues that may be closedIssues that may be closed