MCPcopy Index your code
hub / github.com/python/cpython / subtask

Method subtask

Lib/test/test_asyncio/test_runners.py:463–466  ·  view source on GitHub ↗
(task)

Source from the content-addressed store, hash-verified

461 assert threading.current_thread() is threading.main_thread()
462
463 async def subtask(task):
464 await asyncio.sleep(0)
465 task.cancel()
466 interrupt_self()
467
468 async def coro():
469 asyncio.create_task(subtask(asyncio.current_task()))

Callers

nothing calls this directly

Calls 3

interrupt_selfFunction · 0.85
sleepMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected