import asyncio
async def f1():
await asyncio.sleep(3)
return 1
async def f2():
await asyncio.sleep(1)
raise Exception()
return 2
async def main():
aws = await asyncio.gather(
*{f1(),
f2()
}, return_exceptions=True
)
print(aws)
asyncio.run(main())\
выовод: [Exception(), 1]
*{f1(), f2()}