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
When I run version 0.670 of mypy with Python 3.7.1, I get:
a.py:7: error: Argument 1 to "func" has incompatible type "**Dict[str, object]"; expected "int"
It seems to be trying to match the **kwargs positionally instead of using the names. I would not expect mypy to produce an error on this code. You can see in line 6 that if I specify the optional argument explicitly, there is no error.
This same type of behavior was described in issue #1969, but I'm still getting the behavior with version 0.670, which includes those changes.
The text was updated successfully, but these errors were encountered:
Mypy is technically right because it doesn't record which keys are present in a dictionary, it is just Dict[str, object]. One could potentially use TypedDict to avoid this, but then this is a duplicate of #5382.
I am reporting a bug illustrated by the following code.
When I run version 0.670 of
mypy
with Python 3.7.1, I get:a.py:7: error: Argument 1 to "func" has incompatible type "**Dict[str, object]"; expected "int"
It seems to be trying to match the
**kwargs
positionally instead of using the names. I would not expect mypy to produce an error on this code. You can see in line 6 that if I specify theoptional
argument explicitly, there is no error.This same type of behavior was described in issue #1969, but I'm still getting the behavior with version 0.670, which includes those changes.
The text was updated successfully, but these errors were encountered: