]> granicus.if.org Git - python/commitdiff
issue25982 - Add a class definition for managers.Namespace in the multiprocessing...
authorSenthil Kumaran <senthil@uthcode.com>
Wed, 20 Jan 2016 11:10:13 +0000 (03:10 -0800)
committerSenthil Kumaran <senthil@uthcode.com>
Wed, 20 Jan 2016 11:10:13 +0000 (03:10 -0800)
Doc/library/multiprocessing.rst

index e369e2b134268b37ca2815c34a92c6f541db79db..5fdd0e238ee489dc8abae47681d9c4d6d1e3cc29 100644 (file)
@@ -316,7 +316,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:`list`, :class:`dict`, :class:`~managers.Namespace`, :class:`Lock`,
    :class:`RLock`, :class:`Semaphore`, :class:`BoundedSemaphore`,
    :class:`Condition`, :class:`Event`, :class:`Barrier`,
    :class:`Queue`, :class:`Value` and :class:`Array`.  For example, ::
@@ -1747,24 +1747,26 @@ 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