Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
673ccf20
Commit
673ccf20
authored
Dec 07, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-ups and examples.
parent
68f1e8d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Doc/whatsnew/3.2.rst
Doc/whatsnew/3.2.rst
+8
-7
No files found.
Doc/whatsnew/3.2.rst
View file @
673ccf20
...
@@ -472,14 +472,10 @@ Some smaller changes made to the core Python language are:
...
@@ -472,14 +472,10 @@ Some smaller changes made to the core Python language are:
produce various issues, especially under Windows. Here is an example
produce various issues, especially under Windows. Here is an example
of enabling the warning from the command line::
of enabling the warning from the command line::
$ ./python -Wdefault
$ ./python -q -Wdefault
Python 3.2a3+ (py3k, Nov 5 2010, 22:58:04)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("foo", "wb")
>>> f = open("foo", "wb")
>>> del f
>>> del f
__main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='foo'>
__main__:1: ResourceWarning: unclosed file <_io.BufferedWriter name='foo'>
>>>
(Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:`477863`.)
(Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:`477863`.)
...
@@ -541,7 +537,7 @@ New, Improved, and Deprecated Modules
...
@@ -541,7 +537,7 @@ New, Improved, and Deprecated Modules
(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and
:issue:`8814`.)
:issue:`8814`.)
* The :mod:`itertools` module has a new
function, :func:`~itertools.accumulate`
* The :mod:`itertools` module has a new
:func:`~itertools.accumulate` function
modeled on APL's *scan* operator and on Numpy's *accumulate* function:
modeled on APL's *scan* operator and on Numpy's *accumulate* function:
>>> list(accumulate(8, 2, 50))
>>> list(accumulate(8, 2, 50))
...
@@ -577,7 +573,12 @@ New, Improved, and Deprecated Modules
...
@@ -577,7 +573,12 @@ New, Improved, and Deprecated Modules
in favor of a plain :keyword:`with` statement which can accept multiple
in favor of a plain :keyword:`with` statement which can accept multiple
context managers. The latter technique is faster (because it is built-in),
context managers. The latter technique is faster (because it is built-in),
and it does a better job finalizing multiple context managers when one of them
and it does a better job finalizing multiple context managers when one of them
raises an exception.
raises an exception::
>>> 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 and Mattias Brändström;
(Contributed by Georg Brandl and Mattias Brändström;
`appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
`appspot issue 53094 <http://codereview.appspot.com/53094>`_.)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment