(original) (raw)

changeset: 100001:32ee5d197500 branch: 3.5 parent: 99999:f9461f1e0559 user: Senthil Kumaran senthil@uthcode.com date: Wed Jan 20 03:10:13 2016 -0800 files: Doc/library/multiprocessing.rst description: issue25982 - Add a class definition for managers.Namespace in the multiprocessing docs. diff -r f9461f1e0559 -r 32ee5d197500 Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst Wed Jan 20 11:12:38 2016 +0100 +++ b/Doc/library/multiprocessing.rst Wed Jan 20 03:10:13 2016 -0800 @@ -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 /senthil@uthcode.com