Argument 1 to "__anext__" of "AsyncIterator" has incompatible type "AsyncIterator[_T_co]"; expected "AsyncIterator[_T_co]" #12723
Labels
bug
mypy got something wrong
topic-async
async, await, asyncio
topic-error-reporting
How we report errors
topic-usability
To Reproduce
While making changes in websockets to account for changes in mypy 0.941 -> 0.950, I encountered this error:
Regardless of what actually happens, "incompatible A, expected A" is not a helpful error message. This is why I am reporting this bug. See https://github.com/aaugustin/websockets/runs/6272618187?check_suite_focus=true for the test run where this happened.
I'm sorry, I'm not sure I will find the motivation to reduce this to a minimal test case. I'm probably going to pile
cast()
until mypy passes. If you're interested, you can reproduce by checking out this commit python-websockets/websockets@dedc0dd and running mypy 0.950 on it. If not, just close this.Expected Behavior
Either no error — apparently mypy gets what it expects? — or an error message that makes sense.
Actual Behavior
A nonsensical error message.
Your Environment
mypy.ini
(and other config files): -The text was updated successfully, but these errors were encountered: