Skip to content

Commit 8073c8c

Browse files
General clarity improvements
1 parent 9a0a7a5 commit 8073c8c

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

peps/pep-0797.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Abstract
1515
This PEP introduces a new :func:`~concurrent.interpreters.share` function to
1616
the :mod:`concurrent.interpreters` module, which allows any arbitrary object
1717
to be shared across interpreters using an object proxy, at the cost of being
18-
less efficient under multithreaded code.
18+
less efficient to concurrently access across multiple interpreters.
1919

2020
For example:
2121

@@ -92,10 +92,9 @@ Interpreter Switching
9292

9393
When interacting with the wrapped object, the proxy will switch to the
9494
interpreter in which the object was created. This must happen for any access
95-
to the object, such as accessing attributes or making modifications to the object's
96-
:term:`reference count`. To visualize, ``foo`` in the following code is only
97-
ever called in the main interpreter, despite being accessed in subinterpreters
98-
through a proxy:
95+
to the object, such as accessing attributes. To visualize, ``foo`` in the
96+
following code is only ever called in the main interpreter, despite being
97+
accessed in subinterpreters through a proxy:
9998

10099
.. code-block:: python
101100
@@ -288,10 +287,10 @@ in the wrapped object's interpreter. To visualize:
288287
Interpreter Lifetimes
289288
*********************
290289

291-
When an interpreter is destroyed, proxies wrapping objects from that
292-
interpreter may still exist elsewhere. To prevent this from causing crashes,
293-
an interpreter will invalidate all proxies pointing to its any of its objects
294-
by overwriting their wrapped object with ``None``.
290+
When an interpreter is destroyed, shared object proxies wrapping objects
291+
owned by that interpreter may still exist elsewhere. To prevent this
292+
from causing crashes, an interpreter will invalidate all proxies pointing
293+
to any object it owns by overwriting the proxy's wrapped object with ``None``.
295294

296295
To demonstrate, the following snippet first prints out ``Alive``, and then
297296
``None`` after deleting the interpreter:
@@ -317,7 +316,7 @@ To demonstrate, the following snippet first prints out ``Alive``, and then
317316
318317
Note that the proxy is not physically replaced (``wrapped`` in the above example
319318
is still a ``SharedObjectProxy`` instance), but instead has its wrapped object
320-
replaced to ``None``.
319+
replaced with ``None``.
321320

322321

323322
Backwards Compatibility

0 commit comments

Comments
 (0)