pep-567: Fix nits/typos (#541)
This commit is contained in:
parent
583a14f814
commit
c25174f10d
10
pep-0567.rst
10
pep-0567.rst
|
@ -108,12 +108,12 @@ Specification
|
|||
A new standard library module ``contextvars`` is added with the
|
||||
following APIs:
|
||||
|
||||
1. ``copy_context() -> Context`` function is used to get a copy of
|
||||
1. The ``copy_context() -> Context`` function is used to get a copy of
|
||||
the current ``Context`` object for the current OS thread.
|
||||
|
||||
2. ``ContextVar`` class to declare and access context variables.
|
||||
2. The ``ContextVar`` class to declare and access context variables.
|
||||
|
||||
3. ``Context`` class encapsulates context state. Every OS thread
|
||||
3. The ``Context`` class encapsulates context state. Every OS thread
|
||||
stores a reference to its current ``Context`` instance.
|
||||
It is not possible to control that reference directly.
|
||||
Instead, the ``Context.run(callable, *args, **kwargs)`` method is
|
||||
|
@ -329,7 +329,7 @@ dictionary using Hash Array Mapped Tries (HAMT); see :pep:`550`
|
|||
for analysis of HAMT performance [1]_.
|
||||
|
||||
For the purposes of this section, we implement an immutable dictionary
|
||||
using a copy-on-write approach and built-in dict type::
|
||||
using a copy-on-write approach and the built-in dict type::
|
||||
|
||||
class _ContextData:
|
||||
|
||||
|
@ -658,7 +658,7 @@ Such code can be converted to use the ``contextvars`` module::
|
|||
precision.set(0.5)
|
||||
|
||||
# To read the current precision:
|
||||
precision.get()
|
||||
print(precision.get())
|
||||
|
||||
|
||||
Offloading execution to other threads
|
||||
|
|
Loading…
Reference in New Issue