pep-550: Fix a couple of typos (#387)
This commit is contained in:
parent
c99d31840f
commit
dbdf6917b9
|
@ -330,7 +330,7 @@ compatibility.
|
||||||
The main reason for why tasks inherit the context, and threads do
|
The main reason for why tasks inherit the context, and threads do
|
||||||
not, is the common usage intent. Tasks are often used for relatively
|
not, is the common usage intent. Tasks are often used for relatively
|
||||||
short-running operations which are logically tied to the code that
|
short-running operations which are logically tied to the code that
|
||||||
spawned the tasks (like running a coroutine with a timeout in
|
spawned the task (like running a coroutine with a timeout in
|
||||||
asyncio). OS threads, on the other hand, are normally used for
|
asyncio). OS threads, on the other hand, are normally used for
|
||||||
long-running, logically separate code.
|
long-running, logically separate code.
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ Context variable propagation between tasks::
|
||||||
|
|
||||||
async def sub():
|
async def sub():
|
||||||
# Sleeping will make sub() run after
|
# Sleeping will make sub() run after
|
||||||
# `var` is modified in main().
|
# "var" is modified in main().
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
# The value of "var" is inherited from main(), but any
|
# The value of "var" is inherited from main(), but any
|
||||||
|
@ -449,7 +449,7 @@ The context variable object has the following methods and attributes:
|
||||||
|
|
||||||
* ``get(*, topmost=False, default=None)``, if *topmost* is ``False``
|
* ``get(*, topmost=False, default=None)``, if *topmost* is ``False``
|
||||||
(the default), traverses the execution context top-to-bottom, until
|
(the default), traverses the execution context top-to-bottom, until
|
||||||
the variable value is found, if *topmost* is ``True``, returns
|
the variable value is found. If *topmost* is ``True``, returns
|
||||||
the value of the variable in the topmost logical context.
|
the value of the variable in the topmost logical context.
|
||||||
If the variable value was not found, returns the value of *default*.
|
If the variable value was not found, returns the value of *default*.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue