[docs] [issue22474] No explanation of how a task gets destroyed in asyncio 'task' documentation

STINNER Victor report at bugs.python.org
Wed Sep 24 16:34:24 CEST 2014


STINNER Victor added the comment:

"destroyed" means "collected by the garbage collector", when the last reference the task objected was cleared. To be honest, I have no idea who keeps a reference to tasks nor how the "pending task destroyed" bug occurs.

"pending" means that the execution of the coroutine object didn't finish. In fact, it's related to Task.done(): a task is pending is task.done() is False.

There is a corner case: if task.cancel() was called but the coroutine object was not executed yet to handle the CancelledError, the task is still "pending".

Maybe "pending" is not the best word, and "not done" is better.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22474>
_______________________________________


More information about the docs mailing list