diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-10 20:45:42 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-10 20:45:42 (GMT) |
commit | dd6507eb8617fd435b9d282215f5d802bf45b64f (patch) | |
tree | cf585d874c0a58a84fadedfffd481d2aae924fce /Doc/library | |
parent | 9f69b86756bd7084256fda9499111313a081f033 (diff) | |
parent | 148679982f851e2952b9d34e6ae7932f89650c1d (diff) | |
download | cpython-dd6507eb8617fd435b9d282215f5d802bf45b64f.zip cpython-dd6507eb8617fd435b9d282215f5d802bf45b64f.tar.gz cpython-dd6507eb8617fd435b9d282215f5d802bf45b64f.tar.bz2 |
Issue #22369: Change "context manager protocol" to "context management protocol".
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/asyncio-sync.rst | 4 | ||||
-rw-r--r-- | Doc/library/mailbox.rst | 2 | ||||
-rw-r--r-- | Doc/library/multiprocessing.rst | 8 | ||||
-rw-r--r-- | Doc/library/ossaudiodev.rst | 4 | ||||
-rw-r--r-- | Doc/library/tarfile.rst | 2 | ||||
-rw-r--r-- | Doc/library/threading.rst | 8 |
6 files changed, 14 insertions, 14 deletions
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst index 049a0cc..cc80bd7 100644 --- a/Doc/library/asyncio-sync.rst +++ b/Doc/library/asyncio-sync.rst @@ -34,7 +34,7 @@ Lock :meth:`acquire` is a coroutine and should be called with ``yield from``. - Locks also support the context manager protocol. ``(yield from lock)`` + Locks also support the context management protocol. ``(yield from lock)`` should be used as context manager expression. Usage:: @@ -229,7 +229,7 @@ Semaphore counter can never go below zero; when :meth:`acquire` finds that it is zero, it blocks, waiting until some other thread calls :meth:`release`. - Semaphores also support the context manager protocol. + Semaphores also support the context management protocol. The optional argument gives the initial value for the internal counter; it defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError` diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst index 0478ed1..a03fd1c 100644 --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -202,7 +202,7 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF. .. versionchanged:: 3.2 The file object really is a binary file; previously it was incorrectly returned in text mode. Also, the file-like object now supports the - context manager protocol: you can use a :keyword:`with` statement to + context management protocol: you can use a :keyword:`with` statement to automatically close it. .. note:: diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 5726665..2d09f1c 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1046,7 +1046,7 @@ Connection objects are usually created using :func:`Pipe` -- see also using :meth:`Connection.send` and :meth:`Connection.recv`. .. versionadded:: 3.3 - Connection objects now support the context manager protocol -- see + Connection objects now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`. @@ -1506,7 +1506,7 @@ their parent process exits. The manager classes are defined in the The address used by the manager. .. versionchanged:: 3.3 - Manager objects support the context manager protocol -- see + Manager objects support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server process (if it has not already started) and then returns the manager object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`. @@ -1998,7 +1998,7 @@ with the :class:`Pool` class. :meth:`terminate` before using :meth:`join`. .. versionadded:: 3.3 - Pool objects now support the context manager protocol -- see + Pool objects now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`. @@ -2171,7 +2171,7 @@ multiple connections at the same time. unavailable then it is ``None``. .. versionadded:: 3.3 - Listener objects now support the context manager protocol -- see + Listener objects now support the context management protocol -- see :ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`. diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst index c57a4d1..bb5081a 100644 --- a/Doc/library/ossaudiodev.rst +++ b/Doc/library/ossaudiodev.rst @@ -165,7 +165,7 @@ and (read-only) attributes: data written is always equal to the amount of data supplied. .. versionchanged:: 3.2 - Audio device objects also support the context manager protocol, i.e. they can + Audio device objects also support the context management protocol, i.e. they can be used in a :keyword:`with` statement. @@ -357,7 +357,7 @@ The mixer object provides two file-like methods: Returns the file handle number of the open mixer device file. .. versionchanged:: 3.2 - Mixer objects also support the context manager protocol. + Mixer objects also support the context management protocol. The remaining methods are specific to audio mixing: diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index 3adb633..06615f4 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -238,7 +238,7 @@ be finalized; only the internally used file object will be closed. See the :ref:`tar-examples` section for a use case. .. versionadded:: 3.2 - Added support for the context manager protocol. + Added support for the context management protocol. .. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors='surrogateescape', pax_headers=None, debug=0, errorlevel=0) diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 03ee769..e7a3544 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -354,7 +354,7 @@ called in the locked state; it changes the state to unlocked and returns immediately. If an attempt is made to release an unlocked lock, a :exc:`RuntimeError` will be raised. -Locks also support the :ref:`context manager protocol <with-locks>`. +Locks also support the :ref:`context management protocol <with-locks>`. When more than one thread is blocked in :meth:`~Lock.acquire` waiting for the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock.release` @@ -433,7 +433,7 @@ call pairs may be nested; only the final :meth:`~Lock.release` (the :meth:`~Lock.release` of the outermost pair) resets the lock to unlocked and allows another thread blocked in :meth:`~Lock.acquire` to proceed. -Reentrant locks also support the :ref:`context manager protocol <with-locks>`. +Reentrant locks also support the :ref:`context management protocol <with-locks>`. .. class:: RLock() @@ -501,7 +501,7 @@ passed in or one will be created by default. Passing one in is useful when several condition variables must share the same lock. The lock is part of the condition object: you don't have to track it separately. -A condition variable obeys the :ref:`context manager protocol <with-locks>`: +A condition variable obeys the :ref:`context management protocol <with-locks>`: using the ``with`` statement acquires the associated lock for the duration of the enclosed block. The :meth:`~Condition.acquire` and :meth:`~Condition.release` methods also call the corresponding methods of @@ -677,7 +677,7 @@ call. The counter can never go below zero; when :meth:`~Semaphore.acquire` finds that it is zero, it blocks, waiting until some other thread calls :meth:`~Semaphore.release`. -Semaphores also support the :ref:`context manager protocol <with-locks>`. +Semaphores also support the :ref:`context management protocol <with-locks>`. .. class:: Semaphore(value=1) |