Current behavior has a subtle pitfall. The function returns a list of *existing* tasks (not removed by decref or explicit call). If user's code has a strong reference to some task the task will be in return list for unpredictable amount of time, even if the task was done. Returning only *alive* tasks can make a function result more predictable (`not task.done()`). Opinions?
I agree, returning done tasks is pretty useless. This is a new function so let's fix its behavour. We need to: 1. Document this difference between new asyncio.all_tasks() and now deprecated Task.all_tasks(). 2. Make sure that Task.all_tasks() works in 3.7 in the same way it was working before 3.7.
After re-thinking I come to another idea: let's keep `all_tasks()` behavior as is but add an `active_tasks()` function for returning all non-finished tasks. It should be done in Python 3.8
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().