summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-12-15 01:53:26 (GMT)
committerGitHub <noreply@github.com>2017-12-15 01:53:26 (GMT)
commit19a44f63c738388ef3c8515348b4ffc061dfd627 (patch)
tree6de5ddd62a1bdee7a90e5fe8fc59348fe7c4f4f8 /Doc/library
parent41264f1cd4d6066b2797ff07cae465c1e06ff3b2 (diff)
downloadcpython-19a44f63c738388ef3c8515348b4ffc061dfd627.zip
cpython-19a44f63c738388ef3c8515348b4ffc061dfd627.tar.gz
cpython-19a44f63c738388ef3c8515348b4ffc061dfd627.tar.bz2
bpo-32327: Convert asyncio functions documented as coroutines to coroutines. (#4872)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/asyncio-eventloop.rst54
1 files changed, 24 insertions, 30 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index c582b27..2679878 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -269,9 +269,8 @@ Creating connections
socket type :py:data:`~socket.SOCK_STREAM`. *protocol_factory* must be a
callable returning a :ref:`protocol <asyncio-protocol>` instance.
- This method is a :ref:`coroutine <coroutine>` which will try to
- establish the connection in the background. When successful, the
- coroutine returns a ``(transport, protocol)`` pair.
+ This method will try to establish the connection in the background.
+ When successful, it returns a ``(transport, protocol)`` pair.
The chronological synopsis of the underlying operation is as follows:
@@ -344,9 +343,8 @@ Creating connections
:py:data:`~socket.SOCK_DGRAM`. *protocol_factory* must be a
callable returning a :ref:`protocol <asyncio-protocol>` instance.
- This method is a :ref:`coroutine <coroutine>` which will try to
- establish the connection in the background. When successful, the
- coroutine returns a ``(transport, protocol)`` pair.
+ This method will try to establish the connection in the background.
+ When successful, the it returns a ``(transport, protocol)`` pair.
Options changing how the connection is created:
@@ -395,9 +393,8 @@ Creating connections
family is used to communicate between processes on the same machine
efficiently.
- This method is a :ref:`coroutine <coroutine>` which will try to
- establish the connection in the background. When successful, the
- coroutine returns a ``(transport, protocol)`` pair.
+ This method will try to establish the connection in the background.
+ When successful, the it returns a ``(transport, protocol)`` pair.
*path* is the name of a UNIX domain socket, and is required unless a *sock*
parameter is specified. Abstract UNIX sockets, :class:`str`,
@@ -459,8 +456,6 @@ Creating listening connections
set this flag when being created. This option is not supported on
Windows.
- This method is a :ref:`coroutine <coroutine>`.
-
.. versionchanged:: 3.5
On Windows with :class:`ProactorEventLoop`, SSL/TLS is now supported.
@@ -484,8 +479,6 @@ Creating listening connections
parameter is specified. Abstract UNIX sockets, :class:`str`,
:class:`bytes`, and :class:`~pathlib.Path` paths are supported.
- This method is a :ref:`coroutine <coroutine>`.
-
Availability: UNIX.
.. versionchanged:: 3.7
@@ -507,8 +500,7 @@ Creating listening connections
* *ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the
accepted connections.
- This method is a :ref:`coroutine <coroutine>`. When completed, the
- coroutine returns a ``(transport, protocol)`` pair.
+ When completed it returns a ``(transport, protocol)`` pair.
.. versionadded:: 3.5.3
@@ -565,7 +557,10 @@ Low-level socket operations
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
non-blocking.
- This method is a :ref:`coroutine <coroutine>`.
+ .. versionchanged:: 3.7
+ Even though the method was always documented as a coroutine
+ method, before Python 3.7 it returned a :class:`Future`.
+ Since Python 3.7, this is an ``async def`` method.
.. coroutinemethod:: AbstractEventLoop.sock_recv_into(sock, buf)
@@ -578,8 +573,6 @@ Low-level socket operations
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
non-blocking.
- This method is a :ref:`coroutine <coroutine>`.
-
.. versionadded:: 3.7
.. coroutinemethod:: AbstractEventLoop.sock_sendall(sock, data)
@@ -596,7 +589,10 @@ Low-level socket operations
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
non-blocking.
- This method is a :ref:`coroutine <coroutine>`.
+ .. versionchanged:: 3.7
+ Even though the method was always documented as a coroutine
+ method, before Python 3.7 it returned an :class:`Future`.
+ Since Python 3.7, this is an ``async def`` method.
.. coroutinemethod:: AbstractEventLoop.sock_connect(sock, address)
@@ -606,8 +602,6 @@ Low-level socket operations
With :class:`SelectorEventLoop` event loop, the socket *sock* must be
non-blocking.
- This method is a :ref:`coroutine <coroutine>`.
-
.. versionchanged:: 3.5.2
``address`` no longer needs to be resolved. ``sock_connect``
will try to check if the *address* is already resolved by calling
@@ -634,7 +628,10 @@ Low-level socket operations
The socket *sock* must be non-blocking.
- This method is a :ref:`coroutine <coroutine>`.
+ .. versionchanged:: 3.7
+ Even though the method was always documented as a coroutine
+ method, before Python 3.7 it returned a :class:`Future`.
+ Since Python 3.7, this is an ``async def`` method.
.. seealso::
@@ -673,8 +670,6 @@ Use :class:`ProactorEventLoop` to support pipes on Windows.
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
non-blocking mode.
- This method is a :ref:`coroutine <coroutine>`.
-
.. coroutinemethod:: AbstractEventLoop.connect_write_pipe(protocol_factory, pipe)
Register write pipe in eventloop.
@@ -687,8 +682,6 @@ Use :class:`ProactorEventLoop` to support pipes on Windows.
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
non-blocking mode.
- This method is a :ref:`coroutine <coroutine>`.
-
.. seealso::
The :meth:`AbstractEventLoop.subprocess_exec` and
@@ -738,8 +731,6 @@ pool of processes). By default, an event loop uses a thread pool executor
:ref:`Use functools.partial to pass keywords to the *func*
<asyncio-pass-keywords>`.
- This method is a :ref:`coroutine <coroutine>`.
-
.. versionchanged:: 3.5.3
:meth:`BaseEventLoop.run_in_executor` no longer configures the
``max_workers`` of the thread pool executor it creates, instead
@@ -747,6 +738,11 @@ pool of processes). By default, an event loop uses a thread pool executor
(:class:`~concurrent.futures.ThreadPoolExecutor`) to set the
default.
+ .. versionchanged:: 3.7
+ Even though the method was always documented as a coroutine
+ method, before Python 3.7 it returned a :class:`Future`.
+ Since Python 3.7, this is an ``async def`` method.
+
.. method:: AbstractEventLoop.set_default_executor(executor)
Set the default executor used by :meth:`run_in_executor`.
@@ -857,8 +853,6 @@ Server
Wait until the :meth:`close` method completes.
- This method is a :ref:`coroutine <coroutine>`.
-
.. attribute:: sockets
List of :class:`socket.socket` objects the server is listening to, or