diff --git a/src/asynchrony/various.py b/src/asynchrony/various.py index e5f89d2..9121134 100644 --- a/src/asynchrony/various.py +++ b/src/asynchrony/various.py @@ -23,8 +23,5 @@ async def fetch_user(user_id: int) -> dict: async def fetch_all_users(user_ids: list[int]) -> list[dict]: - users = [] - for user_id in user_ids: - user = await fetch_user(user_id) - users.append(user) + users = await asyncio.gather(*(fetch_user(user_id) for user_id in user_ids)) return users