3 ms·
Right, so you can just return a coroutine, so the return type of your method is something like `Union[dict, Coroutine]`. However, then downstream (ultimately) h
by Xophmeister 8y ago
Right, so you can just return a coroutine, so the return type of your method is something like `Union[dict, Coroutine]`. However, then downstream (ultimately) has to handle the dichotomy, where the `dict` is as is, but the coroutine needs to be `await`ed.
You can do it, but I personally think it's messy. It's what I really dislike about Python's async model, which you almost necessarily encounter because the stdlib is mostly not async.