Skip to content

Commit 30d158d

Browse files
committed
Incorporate review comments from @willingc
1 parent 59d3230 commit 30d158d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Doc/library/asyncio-tutorial/async-functions.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ and look like this:
99
def f(x, y):
1010
print(x + y)
1111
12+
# Evaluate the function
1213
f(1, 2)
1314
14-
The snippet also shows how the function is evaluated. Async functions are
15-
different in two respects:
15+
Async functions are different in two respects:
1616

1717
.. code-block:: python
1818
@@ -21,13 +21,17 @@ different in two respects:
2121
async def f(x, y):
2222
print(x + y)
2323
24+
# Execute the *async* function above
2425
asyncio.run(f(1, 2))
2526
2627
The first difference is that the function declaration is spelled
2728
``async def``. The second difference is that async functions cannot be
28-
executed by simply evaluating them. Here, we use the ``run()`` function
29+
executed by simply evaluating them. Instead, we use the ``run()`` function
2930
from the ``asyncio`` module.
3031

32+
Executing Async Functions
33+
-------------------------
34+
3135
The ``run`` function is only good for executing an async function
3236
from "synchronous" code; and this is usually only used to execute
3337
a "main" async function, from which others can be called in a simpler

Doc/library/asyncio-tutorial/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Asyncio Tutorial
22
================
33

4-
Programming with ``async def`` functions is different to normal Python
4+
Programming with ``async def`` functions is differs from normal Python
55
functions; enough so that it is useful to explain a bit more
66
about what ``asyncio`` is for, and how to use it in typical
77
programs.

0 commit comments

Comments
 (0)