summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2016-01-20 11:18:48 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2016-01-20 11:18:48 (GMT)
commit762d761d6503f14e47dd531ac4b14ccfc9a2853d (patch)
treee59883db5234cd6a04e75830a50d0981c8800304 /Doc
parent9b5177c41ae507c7e14a949c93f0d68ec54b6ecf (diff)
downloadcpython-762d761d6503f14e47dd531ac4b14ccfc9a2853d.zip
cpython-762d761d6503f14e47dd531ac4b14ccfc9a2853d.tar.gz
cpython-762d761d6503f14e47dd531ac4b14ccfc9a2853d.tar.bz2
issue25982 - Add a class definition for managers.Namespace in the multiprocessing docs.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/multiprocessing.rst31
1 files changed, 16 insertions, 15 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index cab4806..0df48cd 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -215,7 +215,7 @@ However, if you really do need to use some shared data then
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 @@ their parent process exits. The manager classes are defined in the
lproxy[0] = d
-Namespace objects
->>>>>>>>>>>>>>>>>
+.. class:: Namespace
-A namespace object has no public methods, but does have writable attributes.
-Its representation shows the values of its attributes.
+ A type that can register with :class:`SyncManager`.
-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:
+ A namespace object has no public methods, but does have writable attributes.
+ Its representation shows the values of its attributes.
-.. doctest::
+ 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')
+ >>> 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