After an off-list discussion I think I was able to convince Andrew to change the behaviour of the newly added asyncio.all_tasks() to return only pending tasks. The logic behind this is that:
1. there's no good known use case for returning a list of all non-GC-ed tasks; if such a case exists, it's easy to implement support for it via 'loop.set_task_factory'.
2. OTOH, whenever one uses Task.all_task() they always want to filter out completed tasks.
3. Since this is a new API, it makes sense to design it right and not strive for backwards compatibility with now deprecated asyncio.Task.all_tasks(). |