Sequential version of asyncio.gather
问题 I tried to create a method similar to asyncio.gather, but which will execute the list of tasks sequentially and not asynchronously: async def in_sequence(*tasks): """Executes tasks in sequence""" for task in tasks: await task Next this method was supposed to be used like this: async def some_work(work_name): """Do some work""" print(f"Start {work_name}") await asyncio.sleep(1) if raise_exception: raise RuntimeError(f"{work_name} raise an exception") print(f"Finish {work_name}") async def main