Skip to content

Commit 8e069d5

Browse files
committed
Apply asyncio Task English fixes to docstrings as well.
Also fixed the phrasing in a comment.
1 parent 22dd833 commit 8e069d5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Lib/asyncio/tasks.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def __init__(self, coro, *, loop=None):
7777
# status is still pending
7878
self._log_destroy_pending = True
7979

80-
# On Python 3.3 or older, objects with a destructor part of a reference
81-
# cycle are never destroyed. It's not more the case on Python 3.4 thanks to
82-
# the PEP 442.
80+
# On Python 3.3 or older, objects with a destructor that are part of a
81+
# reference cycle are never destroyed. That's not the case any more on
82+
# Python 3.4 thanks to the PEP 442.
8383
if _PY34:
8484
def __del__(self):
8585
if self._state == futures._PENDING and self._log_destroy_pending:
@@ -155,7 +155,8 @@ def print_stack(self, *, limit=None, file=None):
155155
This produces output similar to that of the traceback module,
156156
for the frames retrieved by get_stack(). The limit argument
157157
is passed to get_stack(). The file argument is an I/O stream
158-
to which the output goes; by default it goes to sys.stderr.
158+
to which the output is written; by default output is written
159+
to sys.stderr.
159160
"""
160161
extracted_list = []
161162
checked = set()
@@ -184,18 +185,18 @@ def print_stack(self, *, limit=None, file=None):
184185
print(line, file=file, end='')
185186

186187
def cancel(self):
187-
"""Request this task to cancel itself.
188+
"""Request that this task cancel itself.
188189
189190
This arranges for a CancelledError to be thrown into the
190191
wrapped coroutine on the next cycle through the event loop.
191192
The coroutine then has a chance to clean up or even deny
192193
the request using try/except/finally.
193194
194-
Contrary to Future.cancel(), this does not guarantee that the
195+
Unlike Future.cancel, this does not guarantee that the
195196
task will be cancelled: the exception might be caught and
196-
acted upon, delaying cancellation of the task or preventing it
197-
completely. The task may also return a value or raise a
198-
different exception.
197+
acted upon, delaying cancellation of the task or preventing
198+
cancellation completely. The task may also return a value or
199+
raise a different exception.
199200
200201
Immediately after this method is called, Task.cancelled() will
201202
not return True (unless the task was already cancelled). A

0 commit comments

Comments
 (0)