[Python-checkins] r72962 - python/branches/py3k/Doc/whatsnew/3.1.rst
raymond.hettinger
python-checkins at python.org
Wed May 27 11:12:20 CEST 2009
Author: raymond.hettinger
Date: Wed May 27 11:12:18 2009
New Revision: 72962
Log:
Update whatsnew for compound with-statements.
Modified:
python/branches/py3k/Doc/whatsnew/3.1.rst
Modified: python/branches/py3k/Doc/whatsnew/3.1.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/3.1.rst (original)
+++ python/branches/py3k/Doc/whatsnew/3.1.rst Wed May 27 11:12:18 2009
@@ -156,6 +156,17 @@
(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::
More information about the Python-checkins
mailing list