Closed
Description
I have (roughly) the following code:
async def foo(x: int): pass
callback = foo # What does this type to?
The problem is I don't know what to type callback
to. It isn't a Callable
as mypy says that "Function does not return a value" when I call await callback(42)
. It isn't an AsyncIterable
, AsyncIterator
, or an AsyncGenerator
as it simply isn't. It isn't a Coroutine
as mypy says that they can't be called.
So am I missing something on how to type this, or does there need to be an AsyncCallable
added to typing
?