Skip to content

Conversation

@elprans
Copy link
Contributor

@elprans elprans commented Jun 1, 2018

Improve the documentation of asyncio.open_connection(),
asyncio.start_server() and their UNIX socket counterparts.

https://bugs.python.org/issue33736

Improve the documentation of `asyncio.open_connection()`, `asyncio.start_server()` and their UNIX socket counterparts.
Copy link
Contributor

@willingc willingc left a comment

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`,
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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`. 
Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks @elprans


See :func:`start_server` for information about return value and other
details.
The *client_connected_cb* parameter is called with two parameters:
Copy link
Contributor

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*.

@1st1
Copy link
Member

1st1 commented Jun 8, 2018

@elprans Could you please address @willingc's comments?

@willingc
Copy link
Contributor

willingc commented Jun 8, 2018

Thanks @elprans for the docs ☀️ @1st1 This looks good to me. I'll leave to you to merge.

@1st1
Copy link
Member

1st1 commented Jun 8, 2018

Thanks for the review @willingc!

@1st1 1st1 merged commit c0d062f into python:master Jun 8, 2018
@miss-islington
Copy link
Contributor

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 Jun 8, 2018
…-7326) (cherry picked from commit c0d062f) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
@bedevere-bot
Copy link

GH-7539 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jun 8, 2018
(cherry picked from commit c0d062f) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants