-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-asyncasync, await, asyncioasync, await, asyncio
Description
Bug Report
I can't seem to find a minimal reproducer, but whenever using watchfiles.awatch(), mypy produces the error:
error: "Coroutine[Any, Any, AsyncGenerator[set[tuple[Change, str]], None]]" has no attribute "__aiter__" (not async iterable) [attr-defined]
As can be seen in the aiohttp-devtools repo:
https://github.com/aio-libs/aiohttp-devtools/actions/runs/5328161994/jobs/9652470528?pr=572
To Reproduce
from watchfiles import awatch
async def main() -> None:
async for i in awatch("/foo"):
print(i)Expected Behavior
No error, as in mypy<1.4.
Not sure what exactly triggers the error, as writing another async iterator function myself does not trigger it.
lindycoder and AdrienPensart
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-asyncasync, await, asyncioasync, await, asyncio