You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to use this with asyncio methods like run and create_task without needing to resort to escape hatches like typing.cast or #type: ignore. I'm not sure that is just having a result.as_coroutine_result or there's a better way.
What would be the reason for using Awaitable instead of Coroutine then? From what I can understand, Coroutines are defined using the async def, which I assume is the use-case for the async_as_result?
Awaitable is just a less specific type used for Coroutine, Future and Task.
I tried to locally change from Awaitable to Coroutine in the result-package in my use-case and mypy was happy.
It would be nice to be able to use this with asyncio methods like
run
andcreate_task
without needing to resort to escape hatches liketyping.cast
or#type: ignore
. I'm not sure that is just having aresult.as_coroutine_result
or there's a better way.An example case is the following:
Running
mypy
on that will produce the following error:The text was updated successfully, but these errors were encountered: