Skip to content

Commit 6bfeb81

Browse files
docs: Add asyncio source code links (GH-16640)
(cherry picked from commit f900064) Co-authored-by: Kyle Stanley <[email protected]>
1 parent 398d847 commit 6bfeb81

11 files changed

+54
-4
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
Event Loop
66
==========
77

8+
**Source code:** :source:`Lib/asyncio/events.py`,
9+
:source:`Lib/asyncio/base_events.py`
10+
11+
------------------------------------
812

913
.. rubric:: Preface
1014

Doc/library/asyncio-exceptions.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
Exceptions
88
==========
99

10+
**Source code:** :source:`Lib/asyncio/exceptions.py`
11+
12+
----------------------------------------------------
1013

1114
.. exception:: TimeoutError
1215

Doc/library/asyncio-future.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
Futures
88
=======
99

10+
**Source code:** :source:`Lib/asyncio/futures.py`,
11+
:source:`Lib/asyncio/base_futures.py`
12+
13+
-------------------------------------
14+
1015
*Future* objects are used to bridge **low-level callback-based code**
1116
with high-level async/await code.
1217

Doc/library/asyncio-platforms.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ All Platforms
2323
Windows
2424
=======
2525

26+
**Source code:** :source:`Lib/asyncio/proactor_events.py`,
27+
:source:`Lib/asyncio/windows_events.py`,
28+
:source:`Lib/asyncio/windows_utils.py`
29+
30+
--------------------------------------
31+
2632
.. versionchanged:: 3.8
2733

2834
On Windows, :class:`ProactorEventLoop` is now the default event loop.

Doc/library/asyncio-protocol.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ This documentation page contains the following sections:
6969
Transports
7070
==========
7171

72+
**Source code:** :source:`Lib/asyncio/transports.py`
73+
74+
----------------------------------------------------
75+
7276
Transports are classes provided by :mod:`asyncio` in order to abstract
7377
various kinds of communication channels.
7478

@@ -431,6 +435,10 @@ Subprocess Transports
431435
Protocols
432436
=========
433437

438+
**Source code:** :source:`Lib/asyncio/protocols.py`
439+
440+
---------------------------------------------------
441+
434442
asyncio provides a set of abstract base classes that should be used
435443
to implement network protocols. Those classes are meant to be used
436444
together with :ref:`transports <asyncio-transport>`.

Doc/library/asyncio-queue.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
Queues
77
======
88

9+
**Source code:** :source:`Lib/asyncio/queues.py`
10+
11+
------------------------------------------------
12+
913
asyncio queues are designed to be similar to classes of the
1014
:mod:`queue` module. Although asyncio queues are not thread-safe,
1115
they are designed to be used specifically in async/await code.

Doc/library/asyncio-stream.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
Streams
77
=======
88

9+
**Source code:** :source:`Lib/asyncio/streams.py`
10+
11+
-------------------------------------------------
12+
913
Streams are high-level async/await-ready primitives to work with
1014
network connections. Streams allow sending and receiving data without
1115
using callbacks or low-level protocols and transports.

Doc/library/asyncio-subprocess.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
Subprocesses
77
============
88

9+
**Source code:** :source:`Lib/asyncio/subprocess.py`,
10+
:source:`Lib/asyncio/base_subprocess.py`
11+
12+
----------------------------------------
13+
914
This section describes high-level async/await asyncio APIs to
1015
create and manage subprocesses.
1116

Doc/library/asyncio-sync.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
Synchronization Primitives
77
==========================
88

9+
**Source code:** :source:`Lib/asyncio/locks.py`
10+
11+
-----------------------------------------------
12+
913
asyncio synchronization primitives are designed to be similar to
1014
those of the :mod:`threading` module with two important caveats:
1115

Doc/library/asyncio-task.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ and Tasks.
1818
Coroutines
1919
==========
2020

21-
Coroutines declared with async/await syntax is the preferred way of
22-
writing asyncio applications. For example, the following snippet
23-
of code (requires Python 3.7+) prints "hello", waits 1 second,
21+
:term:`Coroutines <coroutine>` declared with the async/await syntax is the
22+
preferred way of writing asyncio applications. For example, the following
23+
snippet of code (requires Python 3.7+) prints "hello", waits 1 second,
2424
and then prints "world"::
2525

2626
>>> import asyncio
@@ -238,6 +238,10 @@ Running an asyncio Program
238238
.. versionadded:: 3.7
239239

240240

241+
.. note::
242+
The source code for ``asyncio.run()`` can be found in
243+
:source:`Lib/asyncio/runners.py`.
244+
241245
Creating Tasks
242246
==============
243247

Doc/library/asyncio.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.. module:: asyncio
55
:synopsis: Asynchronous I/O.
66

7-
--------------
7+
-------------------------------
88

99
.. sidebar:: Hello World!
1010

@@ -91,3 +91,6 @@ Additionally, there are **low-level** APIs for
9191
asyncio-api-index.rst
9292
asyncio-llapi-index.rst
9393
asyncio-dev.rst
94+
95+
.. note::
96+
The source code for asyncio can be found in :source:`Lib/asyncio/`.

0 commit comments

Comments
 (0)