diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-07-31 17:46:08 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-07-31 17:46:08 (GMT) |
commit | c91d5eea106d191e931f953bdbdb1db25e051767 (patch) | |
tree | 4ddd0a8c329fc2fb9cc8a78900704829b889a303 /Doc/library | |
parent | 0ce642ebca5f4d0e1b6875b845ad0eb8cb76bbb4 (diff) | |
download | cpython-c91d5eea106d191e931f953bdbdb1db25e051767.zip cpython-c91d5eea106d191e931f953bdbdb1db25e051767.tar.gz cpython-c91d5eea106d191e931f953bdbdb1db25e051767.tar.bz2 |
#17616: wave.open now supports the 'with' statement.
Feature and tests by ClClaudiu.Popa, I added the doc changes.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/aifc.rst | 3 | ||||
-rw-r--r-- | Doc/library/wave.rst | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst index c1cd215..44a0a24 100644 --- a/Doc/library/aifc.rst +++ b/Doc/library/aifc.rst @@ -51,7 +51,8 @@ Module :mod:`aifc` defines the following function: used for writing, the file object should be seekable, unless you know ahead of time how many samples you are going to write in total and use :meth:`writeframesraw` and :meth:`setnframes`. - Objects returned by :func:`.open` also supports the :keyword:`with` statement. + The :func:`.open` function may be used in a :keyword:`with` statement. When + the :keyword:`with` block completes, the :meth:`~aifc.close` method is called. .. versionchanged:: 3.4 Support for the :keyword:`with` statement was added. diff --git a/Doc/library/wave.rst b/Doc/library/wave.rst index 2e64d00..c52af89 100644 --- a/Doc/library/wave.rst +++ b/Doc/library/wave.rst @@ -39,6 +39,11 @@ The :mod:`wave` module defines the following function and exception: :meth:`close` method is called; it is the caller's responsibility to close the file object. + The :func:`.open` function may be used in a :keyword:`with` statement. When + the :keyword:`with` block completes, the :meth:`Wave_read.close() + <wave.Wave_read.close>` or :meth:`Wave_write.close() + <wave.Wave_write.close()>` method is called. + .. function:: openfp(file, mode) |