[Python-checkins] docs: Add asyncio source code links (GH-16640)

Miss Islington (bot) webhook-mailer at python.org
Thu Oct 10 19:25:32 EDT 2019


https://github.com/python/cpython/commit/6bfeb819e5255035563afd7c6224f364d44a6213
commit: 6bfeb819e5255035563afd7c6224f364d44a6213
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-10-10T16:25:28-07:00
summary:

docs: Add asyncio source code links (GH-16640)

(cherry picked from commit f900064ac4b35226caad7502abc8a7e64f1c0e9d)

Co-authored-by: Kyle Stanley <aeros167 at gmail.com>

files:
M Doc/library/asyncio-eventloop.rst
M Doc/library/asyncio-exceptions.rst
M Doc/library/asyncio-future.rst
M Doc/library/asyncio-platforms.rst
M Doc/library/asyncio-protocol.rst
M Doc/library/asyncio-queue.rst
M Doc/library/asyncio-stream.rst
M Doc/library/asyncio-subprocess.rst
M Doc/library/asyncio-sync.rst
M Doc/library/asyncio-task.rst
M Doc/library/asyncio.rst

diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index f763fd5f036d6..1f4f0b6e75b9e 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -5,6 +5,10 @@
 Event Loop
 ==========
 
+**Source code:** :source:`Lib/asyncio/events.py`,
+:source:`Lib/asyncio/base_events.py`
+
+------------------------------------
 
 .. rubric:: Preface
 
diff --git a/Doc/library/asyncio-exceptions.rst b/Doc/library/asyncio-exceptions.rst
index b1e6ecfda15ea..7166d5c4bd88f 100644
--- a/Doc/library/asyncio-exceptions.rst
+++ b/Doc/library/asyncio-exceptions.rst
@@ -7,6 +7,9 @@
 Exceptions
 ==========
 
+**Source code:** :source:`Lib/asyncio/exceptions.py`
+
+----------------------------------------------------
 
 .. exception:: TimeoutError
 
diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst
index c069471b519be..832d58119b7b0 100644
--- a/Doc/library/asyncio-future.rst
+++ b/Doc/library/asyncio-future.rst
@@ -7,6 +7,11 @@
 Futures
 =======
 
+**Source code:** :source:`Lib/asyncio/futures.py`,
+:source:`Lib/asyncio/base_futures.py`
+
+-------------------------------------
+
 *Future* objects are used to bridge **low-level callback-based code**
 with high-level async/await code.
 
diff --git a/Doc/library/asyncio-platforms.rst b/Doc/library/asyncio-platforms.rst
index 7e4a70f91c6ed..390ee1969d096 100644
--- a/Doc/library/asyncio-platforms.rst
+++ b/Doc/library/asyncio-platforms.rst
@@ -23,6 +23,12 @@ All Platforms
 Windows
 =======
 
+**Source code:** :source:`Lib/asyncio/proactor_events.py`,
+:source:`Lib/asyncio/windows_events.py`,
+:source:`Lib/asyncio/windows_utils.py`
+
+--------------------------------------
+
 .. versionchanged:: 3.8
 
    On Windows, :class:`ProactorEventLoop` is now the default event loop.
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
index 67ca121081684..ffac9018127c6 100644
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -69,6 +69,10 @@ This documentation page contains the following sections:
 Transports
 ==========
 
+**Source code:** :source:`Lib/asyncio/transports.py`
+
+----------------------------------------------------
+
 Transports are classes provided by :mod:`asyncio` in order to abstract
 various kinds of communication channels.
 
@@ -431,6 +435,10 @@ Subprocess Transports
 Protocols
 =========
 
+**Source code:** :source:`Lib/asyncio/protocols.py`
+
+---------------------------------------------------
+
 asyncio provides a set of abstract base classes that should be used
 to implement network protocols.  Those classes are meant to be used
 together with :ref:`transports <asyncio-transport>`.
diff --git a/Doc/library/asyncio-queue.rst b/Doc/library/asyncio-queue.rst
index e7775da54f589..524560b691d72 100644
--- a/Doc/library/asyncio-queue.rst
+++ b/Doc/library/asyncio-queue.rst
@@ -6,6 +6,10 @@
 Queues
 ======
 
+**Source code:** :source:`Lib/asyncio/queues.py`
+
+------------------------------------------------
+
 asyncio queues are designed to be similar to classes of the
 :mod:`queue` module.  Although asyncio queues are not thread-safe,
 they are designed to be used specifically in async/await code.
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index 471e6e9099c2c..bb899714a0ec0 100644
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -6,6 +6,10 @@
 Streams
 =======
 
+**Source code:** :source:`Lib/asyncio/streams.py`
+
+-------------------------------------------------
+
 Streams are high-level async/await-ready primitives to work with
 network connections.  Streams allow sending and receiving data without
 using callbacks or low-level protocols and transports.
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
index bd92257c82efa..1d87d2f8005ec 100644
--- a/Doc/library/asyncio-subprocess.rst
+++ b/Doc/library/asyncio-subprocess.rst
@@ -6,6 +6,11 @@
 Subprocesses
 ============
 
+**Source code:** :source:`Lib/asyncio/subprocess.py`,
+:source:`Lib/asyncio/base_subprocess.py`
+
+----------------------------------------
+
 This section describes high-level async/await asyncio APIs to
 create and manage subprocesses.
 
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
index cc8c29dc3b6bc..f080b03bc7c51 100644
--- a/Doc/library/asyncio-sync.rst
+++ b/Doc/library/asyncio-sync.rst
@@ -6,6 +6,10 @@
 Synchronization Primitives
 ==========================
 
+**Source code:** :source:`Lib/asyncio/locks.py`
+
+-----------------------------------------------
+
 asyncio synchronization primitives are designed to be similar to
 those of the :mod:`threading` module with two important caveats:
 
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 6829233793916..1a23661fc772e 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -18,9 +18,9 @@ and Tasks.
 Coroutines
 ==========
 
-Coroutines declared with async/await syntax is the preferred way of
-writing asyncio applications.  For example, the following snippet
-of code (requires Python 3.7+) prints "hello", waits 1 second,
+:term:`Coroutines <coroutine>` declared with the async/await syntax is the
+preferred way of writing asyncio applications.  For example, the following
+snippet of code (requires Python 3.7+) prints "hello", waits 1 second,
 and then prints "world"::
 
     >>> import asyncio
@@ -238,6 +238,10 @@ Running an asyncio Program
     .. versionadded:: 3.7
 
 
+    .. note::
+       The source code for ``asyncio.run()`` can be found in
+       :source:`Lib/asyncio/runners.py`.
+
 Creating Tasks
 ==============
 
diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst
index 6990adb21e360..94a853259d348 100644
--- a/Doc/library/asyncio.rst
+++ b/Doc/library/asyncio.rst
@@ -4,7 +4,7 @@
 .. module:: asyncio
    :synopsis: Asynchronous I/O.
 
---------------
+-------------------------------
 
 .. sidebar:: Hello World!
 
@@ -91,3 +91,6 @@ Additionally, there are **low-level** APIs for
    asyncio-api-index.rst
    asyncio-llapi-index.rst
    asyncio-dev.rst
+
+.. note::
+   The source code for asyncio can be found in :source:`Lib/asyncio/`.



More information about the Python-checkins mailing list