-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-asyncasync, await, asyncioasync, await, asyncio
Description
import asyncio
async def main() -> None:
async with asyncio.TaskGroup() as tg:
tg.create_task(asyncio.sleep(1))
With unused-awaitable enabled, this code generates an unused awaitable error. TaskGroup is expected to wait on any created tasks, so there is no need to await
on them.
Perhaps TaskGroup
can be special-cased to ignore this error, or maybe special-case Task
so the rule only applies when it is returned from asyncio.create_task()
?
alexpovel, tasercake, SiddeshSambasivam and Dreamsorcerer
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-asyncasync, await, asyncioasync, await, asyncio