You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, when I declare a function that has **kwargs along with another parameter with a default value, mypy reports errors when trying to call this function without the default argument.
test.py:15: error: Argument 1 to "bar" has incompatible type "**Dict[str, bool]"; expected "str"
test.py:16: error: Argument 1 to "bar" has incompatible type "**Dict[str, bool]"; expected "str"
test.py:17: error: Argument 2 to "bar" has incompatible type "**Dict[str, bool]"; expected "str"
Found 3 errors in 1 file (checked 1 source file)
Other failing inputs
From my observations: default parameters with {bool, int, float} types work fine (like the foo function). But if the default parameter has type of any of the following types:
Custom classes
Enums
bytes
str
mypy will report errors.
Expected result
foo and bar should behave the same way (e.g. no errors).
Versions
mypy 0.770 and Python 3.8.2
The text was updated successfully, but these errors were encountered:
Hello, when I declare a function that has
**kwargs
along with another parameter with a default value, mypy reports errors when trying to call this function without the default argument.Repro
Mypy output:
Other failing inputs
From my observations: default parameters with
{bool, int, float}
types work fine (like thefoo
function). But if the default parameter has type of any of the following types:bytes
str
mypy will report errors.
Expected result
foo
andbar
should behave the same way (e.g. no errors).Versions
mypy 0.770
andPython 3.8.2
The text was updated successfully, but these errors were encountered: