Skip to main content

Practice ยท 1 of 2

Collect What You Can

Implement async def gather_all(jobs) where jobs are coroutines that may raise. Use asyncio.gather(..., return_exceptions=True) and return (successes, failures): successes is the list of non-exception results in order; failures is the list of exception instances in order. Provide sync wrapper run_collect(jobs).

Difficulty: intermediate

Back to lesson: Practice: gather and Timeout Drills