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
This code throws TypeError: foo() got an unexpected keyword argument 'args' when run.
Expected Behavior
mypy should flag this as an error, as the code throws a TypeError at runtime.
Actual Behavior
mypy reports no errors, even on --strict: Success: no issues found in 1 source file. mypy will attempt to typecheck the argument passed as args= according to the type of args in the function signature, even though passing the argument this way is completely illegal.
Your Environment
Mypy version used: mypy 1.15.0 (compiled: yes)
Mypy command-line flags: --strict
Mypy configuration options from mypy.ini (and other config files): (none)
Python version used: Python 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
The text was updated successfully, but these errors were encountered:
Bug Report
mypy does not flag an error when attempting to pass keyword
args=
to a function that takes*args
, even though that is entirely nonsensical.To Reproduce
https://mypy-play.net/?flags=verbose%2Cstrict&mypy=latest&python=3.12&gist=4e82d2194b167b990da83b77b26bfdf9
This code throws
TypeError: foo() got an unexpected keyword argument 'args'
when run.Expected Behavior
mypy should flag this as an error, as the code throws a
TypeError
at runtime.Actual Behavior
mypy reports no errors, even on
--strict
:Success: no issues found in 1 source file
. mypy will attempt to typecheck the argument passed asargs=
according to the type ofargs
in the function signature, even though passing the argument this way is completely illegal.Your Environment
mypy.ini
(and other config files): (none)Python 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
The text was updated successfully, but these errors were encountered: