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
466bd9d3
Commit
466bd9d3
authored
Jan 24, 2009
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add various items
parent
f6da8d14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
8 deletions
+73
-8
Doc/whatsnew/2.7.rst
Doc/whatsnew/2.7.rst
+73
-8
No files found.
Doc/whatsnew/2.7.rst
View file @
466bd9d3
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
:Release: |release|
:Release: |release|
:Date: |today|
:Date: |today|
.. Fix accents on Kristjan Valur Jonsson, Fuerstenau.
.. $Id$
.. $Id$
Rules for maintenance:
Rules for maintenance:
...
@@ -60,11 +62,6 @@ No release schedule has been decided yet for 2.7.
...
@@ -60,11 +62,6 @@ No release schedule has been decided yet for 2.7.
.. ========================================================================
.. ========================================================================
Kristján Valur Jónsson, issue 4293
Py_AddPendingCall is now thread safe. This allows any worker thread
to submit notifications to the python main thread. This is particularly
useful for asynchronous IO operations.
Other Language Changes
Other Language Changes
======================
======================
...
@@ -95,7 +92,19 @@ Some smaller changes made to the core Python language are:
...
@@ -95,7 +92,19 @@ Some smaller changes made to the core Python language are:
Optimizations
Optimizations
-------------
-------------
To be written.
A few performance enhancements have been added:
* The garbage collector now performs better when many objects are
being allocated without deallocating any. A full garbage collection
pass is only performed when the middle generation has been collected
10 times and when the number of survivor objects from the middle
generation exceeds 10% of the number of objects in the oldest
generation. The second condition was added to reduce the number
of full garbage collections as the number of objects on the heap grows,
avoiding quadratic performance when allocating very many objects.
(Suggested by Martin von Loewis and implemented by Antoine Pitrou;
:issue:`4074`.)
.. ======================================================================
.. ======================================================================
...
@@ -114,6 +123,52 @@ changes, or look through the Subversion logs for all the details.
...
@@ -114,6 +123,52 @@ changes, or look through the Subversion logs for all the details.
prompt for the password if not present. (Added by tarek, with the initial
prompt for the password if not present. (Added by tarek, with the initial
contribution of Nathan Van Gheem; :issue:`4394`.)
contribution of Nathan Van Gheem; :issue:`4394`.)
* The :mod:`bz2` module's :class:`BZ2File` now supports the context
management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``.
(Contributed by Hagen Fuerstenau; :issue:`3860`.)
* A new :class:`Counter` class in the :mod:`collections` module is
useful for tallying data. :class:`Counter` instances behave mostly
like dictionaries but return zero for missing keys instead of
raising a :exc:`KeyError`::
>>> from collections import Counter
>>> c=Counter()
>>> for letter in 'here is a sample of english text':
... c[letter] += 1
...
>>> c
Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2,
'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1,
'p': 1, 'r': 1, 'x': 1})
>>> c['e']
5
>>> c['z']
0
There are two additional :class:`Counter` methods: :meth:`most_common`
returns the N most common elements and their counts, and :meth:`elements`
returns an iterator over the contained element, repeating each element
as many times as its count::
>>> c.most_common(5)
[(' ', 6), ('e', 5), ('s', 3), ('a', 2), ('i', 2)]
>>> c.elements() ->
'a', 'a', ' ', ' ', ' ', ' ', ' ', ' ',
'e', 'e', 'e', 'e', 'e', 'g', 'f', 'i', 'i',
'h', 'h', 'm', 'l', 'l', 'o', 'n', 'p', 's',
's', 's', 'r', 't', 't', 'x']
Contributed by Raymond Hettinger; :issue:`1696199`.
* The :mod:`gzip` module's :class:`GzipFile` now supports the context
management protocol, so you can write ``with gzip.GzipFile(...) as f: ...``.
(Contributed by Hagen Fuerstenau; :issue:`3860`.)
* The :class:`io.FileIO` class now raises an :exc:`OSError` when passed
an invalid file descriptor. (Implemented by Benjamin Peterson;
:issue:`4991`.)
* The :mod:`pydoc` module now has help for the various symbols that Python
* The :mod:`pydoc` module now has help for the various symbols that Python
uses. You can now do ``help('<<')`` or ``help('@')``, for example.
uses. You can now do ``help('<<')`` or ``help('@')``, for example.
(Contributed by David Laban; :issue:`4739`.)
(Contributed by David Laban; :issue:`4739`.)
...
@@ -153,7 +208,13 @@ Changes to Python's build process and to the C API include:
...
@@ -153,7 +208,13 @@ Changes to Python's build process and to the C API include:
* If you use the :file:`.gdbinit` file provided with Python,
* If you use the :file:`.gdbinit` file provided with Python,
the "pyo" macro in the 2.7 version will now work when the thread being
the "pyo" macro in the 2.7 version will now work when the thread being
debugged doesn't hold the GIL; the macro will now acquire it before printing.
debugged doesn't hold the GIL; the macro will now acquire it before printing.
(Contributed by haypo XXX; :issue:`3632`.)
(Contributed by Victor Stinner; :issue:`3632`.)
* :cfunc:`Py_AddPendingCall` is now thread safe, letting any
worker thread submit notifications to the main Python thread. This
is particularly useful for asynchronous IO operations.
(Contributed by Kristjan Valur Jonsson; :issue:`4293`.)
.. ======================================================================
.. ======================================================================
...
@@ -165,7 +226,11 @@ Port-Specific Changes: Windows
...
@@ -165,7 +226,11 @@ Port-Specific Changes: Windows
:data:`CRT_ASSEMBLY_VERSION`,
:data:`CRT_ASSEMBLY_VERSION`,
:data:`VC_ASSEMBLY_PUBLICKEYTOKEN`,
:data:`VC_ASSEMBLY_PUBLICKEYTOKEN`,
and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`.
and :data:`LIBRARIES_ASSEMBLY_NAME_PREFIX`.
(Added by Martin von Loewis (XXX check); :issue:`4365`.)
(Contributed by David Cournapeau; :issue:`4365`.)
* The new :cfunc:`_beginthreadex` API is used to start threads, and
the native thread-local storage functions are now used.
(Contributed by Kristjan Valur Jonsson; :issue:`3582`.)
.. ======================================================================
.. ======================================================================
...
...
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