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 | |
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')
-rw-r--r-- | Doc/library/aifc.rst | 3 | ||||
-rw-r--r-- | Doc/library/wave.rst | 5 | ||||
-rw-r--r-- | Doc/whatsnew/3.4.rst | 5 |
3 files changed, 11 insertions, 2 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) diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst index 17cec3f..2575170 100644 --- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -239,8 +239,11 @@ wave The :meth:`~wave.getparams` method now returns a namedtuple rather than a plain tuple. (Contributed by Claudiu Popa in :issue:`17487`.) +:meth:`wave.open` now supports the context manager protocol. (Contributed +by Claudiu Popa in :issue:`17616`.) + stat ---- +---- The stat module is now backed by a C implementation in :mod:`_stat`. A C implementation is required as most of the values aren't standardized and |