Skip to main content

Practice · 1 of 1

Structured fan-out with TaskGroup

CHALLENGE
Difficulty: advanced+25 XP

Implement async def fetch_all(jobs) where jobs is a list of zero-arg async callables: - run ALL jobs concurrently inside one asyncio.TaskGroup - return a list of (index, value) tuples in INPUT order - if any job raises, fetch_all must raise (do not swallow) Determinism note: the graded jobs sleep for staggered durations; the total wall time must reflect concurrency, and results must come back in input order regardless of completion order.

Back to lesson: Practice: TaskGroup Practice