-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-94597: add asyncio.EventLoop #110723
gh-94597: add asyncio.EventLoop #110723
Changes from 7 commits
d2f7090
47ea029
dc9cfee
2beab6e
6290284
ac27e15
ad2c22c
27d96ca
afaecf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1723,6 +1723,14 @@ on Unix and :class:`ProactorEventLoop` on Windows. | |||||||||||||
`MSDN documentation on I/O Completion Ports | ||||||||||||||
<https://docs.microsoft.com/en-ca/windows/desktop/FileIO/i-o-completion-ports>`_. | ||||||||||||||
|
||||||||||||||
.. class:: EventLoop | ||||||||||||||
|
||||||||||||||
Uses the most efficient available event loop for the given | ||||||||||||||
platform. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe something like this? The other classes don't explain that they are subclasses of AbstractEventLoop, should that be explained in ProactorEventLoop and SelectorEventLoop?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quite. I don't like any sentence describing a class object starting with "Uses". Classes are nouns, and the description should explain what the class is, not what it does. Also, the current algorithm for choosing a default is now specified in two places. I think it should be specified only here (and the earlier text should be changed to claim that It's also a good idea to clarify that both concrete classes are subclasses of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok I've pushed a change with some doc tweaks |
||||||||||||||
|
||||||||||||||
.. versionadded:: 3.13 | ||||||||||||||
|
||||||||||||||
.. availability:: Unix, Windows. | ||||||||||||||
graingert marked this conversation as resolved.
Show resolved
Hide resolved
graingert marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
.. class:: AbstractEventLoop | ||||||||||||||
|
||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added :class:`asyncio.EventLoop` for use with the :func:`asyncio.run` *loop_factory* kwarg to avoid calling the asyncio policy system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this ought to explain that it's an alias for one of the above classes, and that it's the one used by default, and that it's selected the way described above (L1689-90). "Uses" doesn't even explain that it's a subclass of AbstractEventLoop.
Maybe we should be less specific about how the default is selected, and probably whatever we say about it should be only said once, but it should be made clear that this class is the default, and the default is this class.