[Python-checkins] cpython (2.7): issue25982 - Add a class definition for managers.Namespace in the
senthil.kumaran
python-checkins at python.org
Wed Jan 20 06:19:01 EST 2016
https://hg.python.org/cpython/rev/8d7aadd40d30
changeset: 100003:8d7aadd40d30
branch: 2.7
parent: 99996:bb2cb184eca9
user: Senthil Kumaran <senthil at uthcode.com>
date: Wed Jan 20 03:18:48 2016 -0800
summary:
issue25982 - Add a class definition for managers.Namespace in the multiprocessing docs.
files:
Doc/library/multiprocessing.rst | 39 ++++++++++----------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -215,7 +215,7 @@
proxies.
A manager returned by :func:`Manager` will support types :class:`list`,
- :class:`dict`, :class:`Namespace`, :class:`Lock`, :class:`RLock`,
+ :class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`,
:class:`Semaphore`, :class:`BoundedSemaphore`, :class:`Condition`,
:class:`Event`, :class:`~multiprocessing.Queue`, :class:`Value` and :class:`Array`. For
example, ::
@@ -1512,24 +1512,25 @@
lproxy[0] = d
-Namespace objects
->>>>>>>>>>>>>>>>>
-
-A namespace object has no public methods, but does have writable attributes.
-Its representation shows the values of its attributes.
-
-However, when using a proxy for a namespace object, an attribute beginning with
-``'_'`` will be an attribute of the proxy and not an attribute of the referent:
-
-.. doctest::
-
- >>> manager = multiprocessing.Manager()
- >>> Global = manager.Namespace()
- >>> Global.x = 10
- >>> Global.y = 'hello'
- >>> Global._z = 12.3 # this is an attribute of the proxy
- >>> print Global
- Namespace(x=10, y='hello')
+.. class:: Namespace
+
+ A type that can register with :class:`SyncManager`.
+
+ A namespace object has no public methods, but does have writable attributes.
+ Its representation shows the values of its attributes.
+
+ However, when using a proxy for a namespace object, an attribute beginning with
+ ``'_'`` will be an attribute of the proxy and not an attribute of the referent:
+
+ .. doctest::
+
+ >>> manager = multiprocessing.Manager()
+ >>> Global = manager.Namespace()
+ >>> Global.x = 10
+ >>> Global.y = 'hello'
+ >>> Global._z = 12.3 # this is an attribute of the proxy
+ >>> print Global
+ Namespace(x=10, y='hello')
Customized managers
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list