(original) (raw)

changeset: 100003:8d7aadd40d30 branch: 2.7 parent: 99996:bb2cb184eca9 user: Senthil Kumaran senthil@uthcode.com date: Wed Jan 20 03🔞48 2016 -0800 files: Doc/library/multiprocessing.rst description: issue25982 - Add a class definition for managers.Namespace in the multiprocessing docs. diff -r bb2cb184eca9 -r 8d7aadd40d30 Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst Wed Jan 20 10:33:51 2016 +0200 +++ b/Doc/library/multiprocessing.rst Wed Jan 20 03🔞48 2016 -0800 @@ -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 /senthil@uthcode.com