Documentation
The high level asyncio documentation warns that one should save the result of asyncio.create_task as the event loop only keeps weak references to tasks.
This same warning is not seen in the low level Event Loop documentation even though the same rules apply. The example code snippets also do not save a reference which would lead readers to believe it is safe to discard the result of the EventLoop.create_task function when it is not.
Relevant function in the high level documentation: https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task
Relevant function in the low level documentation: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_task
Documentation
The high level asyncio documentation warns that one should save the result of
asyncio.create_taskas the event loop only keeps weak references to tasks.This same warning is not seen in the low level Event Loop documentation even though the same rules apply. The example code snippets also do not save a reference which would lead readers to believe it is safe to discard the result of the
EventLoop.create_taskfunction when it is not.Relevant function in the high level documentation: https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task
Relevant function in the low level documentation: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.create_task