Skip to content

Conversation

anordin95
Copy link
Contributor

@anordin95 anordin95 commented Aug 27, 2025

Right now, I think the article creates a logical gap that has the potential to confuse readers.

The "per thread" part implies there can be multiple event loops (via multithreading) in the same memory space. It's quite natural to then wonder how tasks will be associated with event loops when there are multiple event loops to choose from. And how you, the user, could manage which loop a task is assigned to. I see that as an easy way for the reader to be left in the dark, wondering.

I see two potential solutions. One is clarifying how tasks and event loops are paired in a multithreaded environment. The other, not mentioning threads at all. I personally lean towards mentioning threading and how event loops are paired with tasks. It is a detail the reader likely won't immediately need, but that's also not the purpose of a HOWTO/explainer. And I think it's a somewhat simple, interesting and powerful solution.

Approach 1

My suggested phrasing to clarify this is in the PR.

Approach 2

Instead of the proposed changes, remove any references to threads or the idea of multiple event loops. One possible approach would be replacing the relevant paragraph with only this:
":mod:!asyncio automatically associates tasks with the event loop for you.".


📚 Documentation preview 📚: https://cpython-previews--138200.org.readthedocs.build/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant