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
$ mypy typing_bug.py
typing_bug.py:16: error: Overloaded functionimplementation does not accept all possible arguments of signature 1 [misc]
Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.14.1 (compiled: yes)
Mypy command-line flags: None, see above
Mypy configuration options from mypy.ini (and other config files): None.
Python version used: Python 3.12.1
The text was updated successfully, but these errors were encountered:
fromtypingimportoverload@overloaddefset(year: int) ->None:
...
@overloaddefset() ->None:
...
defset(*args: object|int, **kw: int) ->None: # E: Overloaded function implementation does not accept all possible arguments of signature 1pass
If you remove the object | then it passes type checking.
The very wish-washy answer is that it's because "is this implementation alright" uses a generalized subtype check, so there's not the available information. I think mypy could definitely provide more provenance information though.
Bug Report
Erroneous complaint that overloaded function implementation does not accept all possible arguments of signature.
To Reproduce
Expected Behavior
The above should pass type checking.
Pyright's happy enough:
Actual Behavior
Your Environment
1.14.1 (compiled: yes)
mypy.ini
(and other config files): None.The text was updated successfully, but these errors were encountered: