summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2009-03-30 22:30:20 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2009-03-30 22:30:20 (GMT)
commit71d5c28d97a29f9762ad2c9ad4ee9842bdeb64f6 (patch)
tree806cabb5ec7248cf2f11f6f1eaf35ed2d4c72704
parentb585255f02db23a367025ea0be1e197d9f47d698 (diff)
downloadcpython-71d5c28d97a29f9762ad2c9ad4ee9842bdeb64f6.zip
cpython-71d5c28d97a29f9762ad2c9ad4ee9842bdeb64f6.tar.gz
cpython-71d5c28d97a29f9762ad2c9ad4ee9842bdeb64f6.tar.bz2
Add several items and placeholders
-rw-r--r--Doc/whatsnew/2.7.rst132
1 files changed, 90 insertions, 42 deletions
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index 9148743..296f666 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -6,7 +6,8 @@
:Release: |release|
:Date: |today|
-.. Fix accents on Kristjan Valur Jonsson, Fuerstenau.
+.. Fix accents on Kristjan Valur Jonsson, Fuerstenau, Tarek Ziade.
+.. OrderedDict
.. $Id$
Rules for maintenance:
@@ -57,10 +58,18 @@ No release schedule has been decided yet for 2.7.
.. ========================================================================
.. Large, PEP-level features and changes should be described here.
-.. Should there be a new section here for 3k migration?
-.. Or perhaps a more general section describing module changes/deprecation?
.. ========================================================================
+PEP 372: Adding an ordered dictionary to collections
+=============================
+
+XXX write this
+
+Several modules will now use :class:`OrderedDict` by default. The
+:mod:`ConfigParser` module uses :class:`OrderedDict` for the list
+of sections and the options within a section.
+The :method:`namedtuple._asdict` method returns an :class:`OrderedDict`
+as well.
Other Language Changes
@@ -86,6 +95,34 @@ Some smaller changes made to the core Python language are:
(Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
+.. ======================================================================
+
+
+Optimizations
+-------------
+
+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`.)
+
+* The garbage collector tries to avoid tracking simple containers
+ which can't be part of a cycle. In Python 2.7, this is now true for
+ tuples and dicts containing atomic types (such as ints, strings,
+ etc.). Transitively, a dict containing tuples of atomic types won't
+ be tracked either. This helps reduce the cost of each
+ garbage collection by decreasing the number of objects to be
+ considered and traversed by the collector.
+ (Contributed by Antoine Pitrou; :issue:`4688`.)
+
* Integers are now stored internally either in base 2**15 or in base
2**30, the base being determined at build time. Previously, they
were always stored in base 2**15. Using base 2**30 gives
@@ -93,7 +130,7 @@ Some smaller changes made to the core Python language are:
benchmark results on 32-bit machines have been mixed. Therefore,
the default is to use base 2**30 on 64-bit machines and base 2**15
on 32-bit machines; on Unix, there's a new configure option
- --enable-big-digits that can be used to override this default.
+ :option:`--enable-big-digits` that can be used to override this default.
Apart from the performance improvements this change should be
invisible to end users, with one exception: for testing and
@@ -109,38 +146,12 @@ Some smaller changes made to the core Python language are:
(Contributed by Mark Dickinson; :issue:`4258`.)
-
-.. ======================================================================
-
-
-Optimizations
--------------
-
-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`.)
-
-* The garbage collector tries to avoid tracking simple containers which
- can't be part of a cycle. As of now, this is true for tuples and dicts
- containing atomic types (such as ints, strings, etc.). Transitively, a dict
- containing tuples of atomic types won't be tracked either. This helps bring
- down the individual cost of each garbage collection, since it decreases the
- number of objects to be considered and traversed by the collector.
-
- To help diagnosing this optimization, a new function in the :mod:`gc`
- module, :func:`is_tracked`, returns True if a given instance is tracked
- by the garbage collector, False otherwise.
- (Contributed by Antoine Pitrou; :issue:`4688`.)
-
+* The division algorithm for long integers has been made faster
+ by tightening the inner loop, doing shifts instead of multiplications,
+ and fixing an unnecessary extra iteration.
+ Various benchmarks show speedups of between 50% and 150% for long
+ integer divisions and modulo operations.
+ (Contributed by Mark Dickinson; :issue:`5512`.)
.. ======================================================================
@@ -153,14 +164,11 @@ changes, sorted alphabetically by module name. Consult the
:file:`Misc/NEWS` file in the source tree for a more complete list of
changes, or look through the Subversion logs for all the details.
-* In Distutils, distutils.sdist.add_defaults now uses package_dir and data_files
- to feed MANIFEST.
-
-* It is not mandatory anymore to store clear text passwords in the
+* It is no longer mandatory to store clear-text passwords in the
:file:`.pypirc` file when registering and uploading packages to PyPI. As long
as the username is present in that file, the :mod:`distutils` package will
- prompt for the password if not present. (Added by tarek, with the initial
- contribution of Nathan Van Gheem; :issue:`4394`.)
+ prompt for the password if not present. (Added by Tarek Ziade,
+ with the initial contribution by 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: ...``.
@@ -200,6 +208,13 @@ changes, or look through the Subversion logs for all the details.
Contributed by Raymond Hettinger; :issue:`1696199`.
+* In Distutils, :func:`distutils.sdist.add_defaults` now uses
+ *package_dir* and *data_files* to feed MANIFEST.
+
+* A new function in the :mod:`gc` module, :func:`is_tracked`, returns
+ True if a given instance is tracked by the garbage collector, False
+ otherwise. (Contributed by Antoine Pitrou; :issue:`4688`.)
+
* 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`.)
@@ -208,6 +223,17 @@ changes, or look through the Subversion logs for all the details.
an invalid file descriptor. (Implemented by Benjamin Peterson;
:issue:`4991`.)
+* The :class:`itertools`
+* The :mod:`json` module was upgraded to version 2.0.9 of the
+ simplejson package, which includes a C extension that makes
+ encoding and decoding faster.
+ (Contributed by Bob Ippolito; :issue:`4136`.)
+
+ To support the new :class:`OrderedDict` type, :func:`json.load`
+ now has an optional *object_pairs_hook* parameter that will be called
+ with any object literal that decodes to a list of pairs.
+ (Contributed by Raymond Hettinger; :issue:`5381`.)
+
* The :mod:`pydoc` module now has help for the various symbols that Python
uses. You can now do ``help('<<')`` or ``help('@')``, for example.
(Contributed by David Laban; :issue:`4739`.)
@@ -229,6 +255,13 @@ changes, or look through the Subversion logs for all the details.
(Contributed by Gregory P. Smith.)
+* The :mod:`unittest` module was enhanced in several ways.
+ Test cases can raise the :exc:`SkipTest` exception to skip a test.
+ (:issue:`1034053`.)
+ It will now use 'x' for expected failures
+ and 'u' for unexpected successes when run in its verbose mode.
+ (Contributed by Benjamin Peterson.)
+
* The :func:`is_zipfile` function in the :mod:`zipfile` module will now
accept a file object, in addition to the path names accepted in earlier
versions. (Contributed by Gabriel Genellina; :issue:`4756`.)
@@ -236,6 +269,11 @@ changes, or look through the Subversion logs for all the details.
.. ======================================================================
.. whole new modules get described in subsections here
+importlib: Importing Modules
+------------------------------
+
+XXX write this
+
ttk: Themed Widgets for Tk
--------------------------
@@ -294,6 +332,16 @@ Port-Specific Changes: Mac OS X
-----------------------------------
+Other Changes and Fixes
+=======================
+
+* The :file:`regrtest.py` script now takes a :option:`--randseed=`
+ switch that takes an integer that will be used as the random seed
+ for the :option:`-r` option that executes tests in random order.
+ The :option:`-r` option also now reports the seed that was used
+ (Added by Collin Winter.)
+
+
.. ======================================================================
Porting to Python 2.7