With this code:
from typing import Coroutine
import asyncio
async def foo(func: Coroutine):
await asyncio.gather(
func()
)
I get the following false positive warning from sonarlint:
Fix this call; Previous type checks suggest that “func” has type Coroutine and it is not callable.sonarlint(python:S5864)
This is usually correct but we need to add a special case to silence the warning when a Coroutine is called inside an asyncio.gather
call.