Bug Report
mypy seems to be unwilling to bind self to a decorated method if the method's return type is declared as a Protocol with __call__, but is willing to do so if the return type is Callable. See the example below.
To Reproduce
https://mypy-play.net/?gist=2fb651ddee58d4176237eb3c3dfb7c1a
Expected Behavior
I expect no type errors in any of the examples provided.
Actual Behavior
The first example (with class A and Callable) is accepted. The second is not.
decorator_confusion.py:45: error: Too few arguments for "__call__" of "MyCallable" [call-arg]
Your Environment
Tested on mypy 1.18.2 and 2.1.0. Python version 3.14.5
Bug Report
mypyseems to be unwilling to bindselfto a decorated method if the method's return type is declared as aProtocolwith__call__, but is willing to do so if the return type isCallable. See the example below.To Reproduce
https://mypy-play.net/?gist=2fb651ddee58d4176237eb3c3dfb7c1a
Expected Behavior
I expect no type errors in any of the examples provided.
Actual Behavior
The first example (with class
AandCallable) is accepted. The second is not.Your Environment
Tested on mypy 1.18.2 and 2.1.0. Python version 3.14.5