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

loop.call_soon returns one kind of handle while loop.call_later returns another. What is the concrete difference between these two handle types inside CPython's asyncio?

import asyncio async def m(): loop = asyncio.get_running_loop() h = loop.call_soon(lambda: None) th = loop.call_later(10, lambda: None) print(type(h).__name__, type(th).__name__) th.cancel() asyncio.run(m())