diff options
author | Raymond Hettinger <python@rcn.com> | 2009-04-06 22:39:03 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-04-06 22:39:03 (GMT) |
commit | f4cc2c4afec82e83053b861f6a70006fb28bb3e2 (patch) | |
tree | 9e19a8049935e9781a9681a48416a192cee3d9ab /Doc | |
parent | d26b7af62a6b104cb7bc5e3f3dc557722c8b83df (diff) | |
download | cpython-f4cc2c4afec82e83053b861f6a70006fb28bb3e2.zip cpython-f4cc2c4afec82e83053b861f6a70006fb28bb3e2.tar.gz cpython-f4cc2c4afec82e83053b861f6a70006fb28bb3e2.tar.bz2 |
Add example. Fix spelling. Fix patch attribution.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/3.1.rst | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst index 592e930..c1f83f0 100644 --- a/Doc/whatsnew/3.1.rst +++ b/Doc/whatsnew/3.1.rst @@ -158,10 +158,14 @@ Some smaller changes made to the core Python language are: (Contributed by Kevin Walzer and Guilherme Polo; :issue:`2618` and :issue:`2983`.) -* The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classs now support - the context manager protocol. +* The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support + the context manager protocol:: - (Contributed by Jacques Frechet; :issue:`4272`.) + >>> # Automatically close file after writing + >>> with gzip.GzipFile(filename, "wb") as f: + ... f.write(b"xxx") + + (Contributed by Antoine Pitrou.) * The :mod:`Decimal` module now supports two new methods to create a decimal object that from a binary :class:`float`. The conversion is |