object concuruntly, and write this construction, but maybe there is better way to do it?
```
async def set_maintenance(regions: [Region]) -> None:
work_reg = [x.set_maintenance() for x in regions]
work_reg2 = [x.check_manual_snapshots() for x in regions]
work_reg.extend(work_reg2)
await asyncio.gather(*work_reg)
```
rewriten like this async def bunch_execution(regions: [Region], methods: list) -> None: final_execution = [] for method in methods: temporary_methods = [getattr(region, method)() for region in regions] final_execution.extend(temporary_methods) await asyncio.gather(*final_execution)
y include type hints???
yes, it very useful
Обсуждают сегодня