bpo-33736: Improve the documentation of asyncio stream APIs by elprans · Pull Request #7326 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation12 Commits2 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Improve the documentation of asyncio.open_connection()
,
asyncio.start_server()
and their UNIX socket counterparts.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @elprans. A few suggestions. Thanks.
@@ -0,0 +1,2 @@ |
---|
Improve the documentation of func:`asyncio.open_connection`, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is a missing : before func.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
:meth:`~AbstractEventLoop.create_server()` except *protocol_factory*; most |
---|
common are positional *host* and *port*, with various optional keyword |
arguments following. |
When specified, the *loop* argument determines which event loop to use, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 47, consider adding:
The callback for a connected client, *client_connected_cb*, contains a *client_reader* and *client_writer*. ... The *client_connected_cb* parameter may be a plain callback function or a :ref:`coroutine function <coroutine>`. If the parameter is a coroutine function, it will be automatically converted into a :class:`Task`.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded the whole paragraph for clarity.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start a UNIX Domain Socket server, with a callback for each client connected. |
See :func:`start_server` for information about return value and other |
details. |
The *client_connected_cb* parameter is called with two parameters: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a few words for better reader understanding:
The callback for a connected client, *client_connected_cb*, contains a *client_reader* and *client_writer*.
Thanks @elprans for the docs ☀️ @1st1 This looks good to me. I'll leave to you to merge.
1st1 approved these changes Jun 8, 2018
Thanks @elprans for the PR, and @1st1 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit c0d062f)
Co-authored-by: Elvis Pranskevichus elvis@magic.io
miss-islington added a commit that referenced this pull request
(cherry picked from commit c0d062f)
Co-authored-by: Elvis Pranskevichus elvis@magic.io