Skip to content

Commit 81c0dce

Browse files
committed
Update whatsnew for compound with-statements.
1 parent c8d952d commit 81c0dce

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Doc/whatsnew/3.1.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ Some smaller changes made to the core Python language are:
156156

157157
(Contributed by Georg Brandl; :issue:`5675`.)
158158

159+
* The syntax of the :keyword:`with` statement now allows multiple context
160+
managers in a single statement::
161+
162+
>>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile:
163+
... for line in infile:
164+
... if '<critical>' in line:
165+
... outfile.write(line)
166+
167+
(Contributed by Georg Brandl;
168+
`appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
169+
159170
* ``round(x, n)`` now returns an integer if *x* is an integer.
160171
Previously it returned a float::
161172

0 commit comments

Comments
 (0)