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()?
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-caseTask
so the rule only applies when it is returned fromasyncio.create_task()
?