Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hrmmmm.

> But who reads all the docs?

asyncio.create_task() doesn't exist in 3.6, and I can't find the string "to avoid a task disappearing" in the doc, so I'll go out on a limb: there is no such doc. However I see the reference to weakref.WeakSet.



The world didn't end in 2016. Welcome to seven years in the future where this documentation does, in fact, exist:

https://docs.python.org/3/library/asyncio-task.html#asyncio....


Some of us have been writing python since 2.x, and quite unsurprisingly wrote asyncio code at 3.6, and still happily support it. Some of us have even asked on HN about maintaining compatibility backwards and forwards between 3.6 and 3.11.

The documentation didn't exist at 3.6, when I wrote the code. I went and checked the source code, and the documentation and reported my findings. Good to know that there's a potential problem, don't you agree? What would you do differently?


I've got to say, I've never actually noticed a problem with "fire and forget" although I use it for more or less disposable tasks to begin with.

However, I've spent some more time looking through asyncio.base_events and

* BaseEventLoop._scheduled is a list()

* BaseEventLoop._ready is a deque()

There is no change between 3.6 and 3.11 in this regard. So this could be a nothingburger if you don't use asyncgens. OTOH I suppose better safe than sorry; the only question is whether no code addressing it is more mentally taxing for the bystander than having code and trusting its implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: