From 81c0dcee658af0966bc91fe20ce2cd807a797aff Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 27 May 2009 09:12:18 +0000 Subject: Update whatsnew for compound with-statements. --- Doc/whatsnew/3.1.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 '' in line: + ... outfile.write(line) + + (Contributed by Georg Brandl; + `appspot issue 53094 `_.) + * ``round(x, n)`` now returns an integer if *x* is an integer. Previously it returned a float:: -- cgit v0.12