mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Update whatsnew for compound with-statements.
This commit is contained in:
parent
c8d952dfe4
commit
81c0dcee65
1 changed files with 11 additions and 0 deletions
|
@ -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::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue