[Python-checkins] cpython (3.5): issue25982 - Add a class definition for managers.Namespace in the

senthil.kumaran python-checkins at python.org
Wed Jan 20 06:12:12 EST 2016


https://hg.python.org/cpython/rev/32ee5d197500
changeset:   100001:32ee5d197500
branch:      3.5
parent:      99999:f9461f1e0559
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Wed Jan 20 03:10:13 2016 -0800
summary:
  issue25982 - Add a class definition for managers.Namespace in the multiprocessing docs.

files:
  Doc/library/multiprocessing.rst |  40 +++++++++++---------
  1 files changed, 21 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
@@ -316,7 +316,7 @@
    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 @@
          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