mirror of
https://github.com/python/cpython.git
synced 2024-11-26 03:14:27 +08:00
Add example. Fix spelling. Fix patch attribution.
This commit is contained in:
parent
d26b7af62a
commit
f4cc2c4afe
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user