I'd like to call exec in an async function and do something like the following code (which is not valid):
import asyncio
async def f():
await exec('x = 1\n' 'await asyncio.sleep(x)')
More precisely, I'd like to be able to wait for a future inside the code that runs in exec.
How can this be achieved?