Skip to content

bpo-33736: Improve the documentation of asyncio stream APIs#7326

Merged
1st1 merged 2 commits into
python:masterfrom
elprans:asyncio-docs
Jun 8, 2018
Merged

bpo-33736: Improve the documentation of asyncio stream APIs#7326
1st1 merged 2 commits into
python:masterfrom
elprans:asyncio-docs

Conversation

@elprans

@elprans elprans commented Jun 1, 2018

Copy link
Copy Markdown
Contributor

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.

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice. Thanks @elprans

Comment thread Doc/library/asyncio-stream.rst Outdated

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

Copy link
Copy Markdown
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

1st1 commented Jun 8, 2018

Copy link
Copy Markdown
Member

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

@willingc

willingc commented Jun 8, 2018

Copy link
Copy Markdown
Contributor

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

@1st1

1st1 commented Jun 8, 2018

Copy link
Copy Markdown
Member

Thanks for the review @willingc!

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

Copy link
Copy Markdown
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
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants