]> granicus.if.org Git - python/commitdiff
docs: Add asyncio source code links (GH-16640)
authorKyle Stanley <aeros167@gmail.com>
Thu, 10 Oct 2019 23:18:46 +0000 (19:18 -0400)
committerYury Selivanov <yury@magic.io>
Thu, 10 Oct 2019 23:18:46 +0000 (19:18 -0400)
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-exceptions.rst
Doc/library/asyncio-future.rst
Doc/library/asyncio-platforms.rst
Doc/library/asyncio-protocol.rst
Doc/library/asyncio-queue.rst
Doc/library/asyncio-stream.rst
Doc/library/asyncio-subprocess.rst
Doc/library/asyncio-sync.rst
Doc/library/asyncio-task.rst
Doc/library/asyncio.rst

index 045787e0ce787551abdadcd6ae47fa55be7df449..240d814f13dea93e67d5d407662cc7a77eb18f14 100644 (file)
@@ -5,6 +5,10 @@
 Event Loop
 ==========
 
+**Source code:** :source:`Lib/asyncio/events.py`,
+:source:`Lib/asyncio/base_events.py`
+
+------------------------------------
 
 .. rubric:: Preface
 
index b1e6ecfda15ead2638ed953bcee224e443a6267a..7166d5c4bd88f9b155b6665ba0b512c28863b526 100644 (file)
@@ -7,6 +7,9 @@
 Exceptions
 ==========
 
+**Source code:** :source:`Lib/asyncio/exceptions.py`
+
+----------------------------------------------------
 
 .. exception:: TimeoutError
 
index c069471b519be95f385e167fa3bc7a31499c0466..832d58119b7b079d1e59dc4b39bae5b6a2126512 100644 (file)
@@ -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.
 
index 7e4a70f91c6ed55f9d92ff47e306468205d68510..390ee1969d096f4109a6e127b9c0cc1714ac285c 100644 (file)
@@ -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.
index 67ca121081684f70b06d3760663d39e0f957a1fa..ffac9018127c669a72bfc08f6e4efd3e68d1f0cd 100644 (file)
@@ -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>`.
index e7775da54f589138407aec5114c565c471cf084c..524560b691d720d6bf39a6aab2517e0a19c57d3d 100644 (file)
@@ -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.
index 471e6e9099c2c4bc89cd99b3e1130049530ef96a..bb899714a0ec06dc269524877c2f38cff99eba61 100644 (file)
@@ -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.
index bd92257c82efa2ba4d4107ca701da83c6592f758..1d87d2f8005ec6554fd276aa4bfe14a9d2c7202a 100644 (file)
@@ -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.
 
index cc8c29dc3b6bc5fc97b94c92d709cc7bf5d9a095..f080b03bc7c51ccc72c6daa254e344a80e5076be 100644 (file)
@@ -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:
 
index 155887a3ab3af9dc2abf6e58bab48e2fc088b665..d992b0011dc6607500bbb68eeca6dfd8a3ea1745 100644 (file)
@@ -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
@@ -240,6 +240,10 @@ Running an asyncio Program
     .. versionchanged:: 3.9
        Updated to use :meth:`loop.shutdown_default_executor`.
 
+    .. note::
+       The source code for ``asyncio.run()`` can be found in
+       :source:`Lib/asyncio/runners.py`.
+
 Creating Tasks
 ==============
 
index 6990adb21e3603db8cf3203a2a8322f1cab7c68a..94a853259d348336720af76673316a193a11b8d8 100644 (file)
@@ -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/`.