Andrew Svetlov added the comment:
Global future objects (and global asyncio objects in general) don't work with
asyncio.run(). The lifecycle of these objects should be closer than loop but
asyncio.run() creates a loop during execution.
I think this is a good design, we have a plan to depreca
New submission from Dima Tisnek :
Let's start with correct code:
import asyncio
async def writer():
await asyncio.sleep(1)
g1.set_result(41)
async def reader():
await g1
async def test():
global g1
g1 = asyncio.Future()
await asyncio.gather(reader(), writer())
asyn