summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-05-27 09:12:18 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-05-27 09:12:18 (GMT)
commit81c0dcee658af0966bc91fe20ce2cd807a797aff (patch)
tree123dcdb660afe2a72f6020e87ba628a5d97aa962 /Doc/whatsnew
parentc8d952dfe4e7c126675d097c921f348584d50ac3 (diff)
downloadcpython-81c0dcee658af0966bc91fe20ce2cd807a797aff.zip
cpython-81c0dcee658af0966bc91fe20ce2cd807a797aff.tar.gz
cpython-81c0dcee658af0966bc91fe20ce2cd807a797aff.tar.bz2
Update whatsnew for compound with-statements.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.1.rst11
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index a28875f..fb439ec 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -156,6 +156,17 @@ Some smaller changes made to the core Python language are:
(Contributed by Georg Brandl; :issue:`5675`.)
+* The syntax of the :keyword:`with` statement now allows multiple context
+ managers in a single statement::
+
+ >>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile:
+ ... for line in infile:
+ ... if '<critical>' in line:
+ ... outfile.write(line)
+
+ (Contributed by Georg Brandl;
+ `appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
+
* ``round(x, n)`` now returns an integer if *x* is an integer.
Previously it returned a float::