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
IMO, mypy shouldn't report any bug, do you agree ?
Actual Behavior
mypy logs an error, which means mypy doesn't recognize A as implementing the Runnableprotocol (which it does)
commands/typing_debug.py:20: error: Argument 1 to "foo" has incompatible type "A"; expected "Runnable[Any]"
commands/typing_debug.py:20: note: Following member(s) of "A" have conflicts:
commands/typing_debug.py:20: note: Expected:
commands/typing_debug.py:20: note: def run(self, *args: Any, **kwargs: Any) -> Any
commands/typing_debug.py:20: note: Got:
commands/typing_debug.py:20: note: def run(self, i: int) -> Any
However if foo is defined as
def foo(func: Runnable[int]) -> int:
...
mypy doesn't report any error.
Your Environment
Mypy version used: 0.971
Mypy command-line flags: no flag
Mypy configuration options from mypy.ini (and other config files): no config file
Python version used: 3.10.2
Operating system and version: MacOS 12.6
The text was updated successfully, but these errors were encountered:
Bug Report
ParamSpec feature doesn't seem to work well when used with Protocol.
To Reproduce
Expected Behavior
IMO, mypy shouldn't report any bug, do you agree ?
Actual Behavior
mypy logs an error, which means mypy doesn't recognize A as implementing the
Runnable
protocol (which it does)However if
foo
is defined asmypy doesn't report any error.
Your Environment
mypy.ini
(and other config files): no config fileThe text was updated successfully, but these errors were encountered: