Skip to content

Commit 2a96782

Browse files
Apply suggestions from code review
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
1 parent 671cc80 commit 2a96782

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

Doc/howto/a-conceptual-overview-of-asyncio.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ recommended patterns.
1010

1111
You might be curious about some key :mod:`!asyncio` concepts.
1212
You'll be comfortably able to answer these questions by the end of this
13-
article.
13+
article:
1414

1515
- What's happening behind the scenes when an object is ``await``\ ed?
1616
- How does :mod:`!asyncio` differentiate between a task which doesn't need
@@ -22,7 +22,7 @@ article.
2222
.. seealso::
2323

2424
The `guide <https://github.com/anordin95/a-conceptual-overview-of-asyncio/
25-
tree/main>`_ which inspired this HOWTO article.
25+
tree/main>`_ that inspired this HOWTO article.
2626

2727
--------------------------------------------
2828
A conceptual overview part 1: the high-level
@@ -45,14 +45,14 @@ done comes from the respect and cooperation of its teammates.
4545
In more technical terms, the event loop contains a queue of jobs to be run.
4646
Some jobs are added directly by you, and some indirectly by :mod:`!asyncio`.
4747
The event loop pops a job from the queue and invokes it (or "gives it control"),
48-
similar to calling a function, then that job runs.
48+
similar to calling a function, and then that job runs.
4949
Once it pauses or completes, it returns control to the event loop.
5050
The event loop will then move on to the next job in its queue and invoke it.
5151
This process repeats indefinitely.
5252
Even if the queue is empty, the event loop continues to cycle (somewhat
5353
aimlessly).
5454

55-
Effective execution relies on tasks sharing well: a greedy job could hog
55+
Effective execution relies on tasks sharing well; a greedy job could hog
5656
control and leave the other tasks to starve, rendering the overall event loop
5757
approach rather useless.
5858

@@ -255,7 +255,7 @@ A conceptual overview part 2: the nuts and bolts
255255
Part 2 goes into detail on the mechanisms :mod:`!asyncio` uses to manage
256256
control flow.
257257
This is where the magic happens.
258-
You'll come away from this section knowing what await does behind the scenes
258+
You'll come away from this section knowing what ``await`` does behind the scenes
259259
and how to make your own asynchronous operators.
260260

261261
================================================
@@ -269,8 +269,8 @@ resume a coroutine.
269269
If the coroutine was paused and is now being resumed, the argument ``arg``
270270
will be sent in as the return value of the ``yield`` statement which originally
271271
paused it.
272-
If the coroutine is being used for the first time, as opposed to being resumed,
273-
arg must be ``None``.
272+
If the coroutine is being used for the first time (as opposed to being resumed)
273+
``arg`` must be ``None``.
274274

275275
:ref:`yield <yieldexpr>`, like usual, pauses execution and returns control
276276
to the caller.
@@ -359,15 +359,15 @@ and the object is a way to keep an eye on that something.
359359

360360
A future has a few important attributes. One is its state which can be either
361361
"pending", "cancelled" or "done".
362-
Another is its result which is set when the state transitions to done.
362+
Another is its result, which is set when the state transitions to done.
363363
Unlike a coroutine, a future does not represent the actual computation to be
364364
done; instead, it represents the status and result of that computation, kind of
365365
like a status light (red, yellow or green) or indicator.
366366

367367
:class:`asyncio.Task` subclasses :class:`asyncio.Future` in order to gain
368368
these various capabilities.
369369
The prior section said tasks store a list of callbacks, which wasn't entirely
370-
true.
370+
correct.
371371
It's actually the ``Future`` class that implements this logic which ``Task``
372372
inherits.
373373

@@ -498,4 +498,4 @@ For reference, you could implement it without futures, like so::
498498

499499
But, that's all for now. Hopefully you're ready to more confidently dive into
500500
some async programming or check out advanced topics in the
501-
:mod:`docs <asyncio>`.
501+
:mod:`rest of the documentation <asyncio>`.

0 commit comments

Comments
 (0)