-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
When passing at least part of the function parameter as an **
expanded dictionary, if one or more of the parameters is missing, a misleading "incomaptible type" is shown, instead of "missing parameter".
See also stackoverflow for a way to get a better (but still not correct, since it lists all the parameters as missing) message
To Reproduce
def my_func(a: str = 'Hello', b: bool = False, c: int = 1):
return a, b, c
input_kwargs = {'b': True}
result = my_func(**input_kwargs)
or see the gist
Actual Behavior
main.py:14: error: Argument 1 to "fib" has incompatible type "**Dict[str, int]"; expected "str"
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 0.812 (or 0.981 on mypy-play)
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini
(and other config files):
check_untyped_defs = True
show_error_codes = True
pretty = True
ignore_missing_imports = True
- Python version used: 3.8 (or 3.10 on mypy-play)
deadnews
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong