As mentioned in the title, what is the asyncio equivalent of Twisted's defer.succeed? Alternatively how do I create a coroutine object from a plain Python value?
Note that this is different from How do we call a normal function where a coroutine is expected?. I could always do something like the following but I was wondering if there was a better way.
value_to_convert_to_coroutine_object = 5
async def foo(bar):
return await asyncio.coroutine(lambda: value_to_convert_to_coroutine_object)()