From: Raymond Hettinger Date: Wed, 27 May 2009 09:12:18 +0000 (+0000) Subject: Update whatsnew for compound with-statements. X-Git-Tag: v3.1rc1~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81c0dcee658af0966bc91fe20ce2cd807a797aff;p=python Update whatsnew for compound with-statements. --- diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst index a28875f4aa..fb439ec7c1 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::