Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonasyncio event loop internalsSingle-choice MCQ

In the snippet below, `create_task(a())` is called but `a` does not run before `'after create_task'` is logged. What does this reveal about `create_task`?

async def main(): log = [] async def a(): log.append('a-start') t = asyncio.create_task(a()) log.append('after create_task') await asyncio.sleep(0) await t print(log) # ?