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
{{ message }}
Repository navigation
User-defined TypeGuard for Callable is coroutine function has errors #13710
I expected mypy to infer in execute_if_coro that my_func_or_coro can receive an a positional integer before the additional *args and **kwargs and that the result will be awaitable using await keyword.
Actual Behavior
Mypy reports 2 errors
Argument 1 to "iscoroutinefunc" has incompatible type "Callable[[int, **_PRouteParams], Any]"; expected "Callable[[int, **_PRouteParams], Any]
Argument 1 has incompatible type "int"; expected "[int, **_PRouteParams.args]"
Your Environment
Mypy version used: 0.971
Mypy command-line flags: N/A
Mypy configuration options from mypy.ini (and other config files):
Activity
A5rocks commentedon Feb 22, 2023
Just as a note, I've used this code to try to test this:
(Just posting so I do not need to change the code next time I check. Needed to add the imports and the
async main+ indentation.)EldarSehayekZenity commentedon Apr 10, 2023
@A5rocks Thank you very much for your PR I see all checks are approved will it be merged and released soon?
A5rocks commentedon Apr 10, 2023
Hi :)
I haven't put in time recently to the PR but I have 2 main things I need to do before it can really be looked at for real:
I hope to have that done in a few days!
A5rocks commentedon May 15, 2023
FYI this is fixed as of Mypy 1.2! Turns out some other changed fixed this, oops.
hauntsaninja commentedon May 15, 2023
mypy_primer --bisect -p test.py --debug --old v1.0.0bisects the change in behaviour to your #14677 :-)JelleZijlstra commentedon May 15, 2023
Should we add a new test case for this?