[Python-checkins] r70788 - python/trunk/Doc/whatsnew/2.7.rst

andrew.kuchling python-checkins at python.org
Tue Mar 31 03:21:01 CEST 2009


Author: andrew.kuchling
Date: Tue Mar 31 03:21:01 2009
New Revision: 70788

Log:
Add various items

Modified:
   python/trunk/Doc/whatsnew/2.7.rst

Modified: python/trunk/Doc/whatsnew/2.7.rst
==============================================================================
--- python/trunk/Doc/whatsnew/2.7.rst	(original)
+++ python/trunk/Doc/whatsnew/2.7.rst	Tue Mar 31 03:21:01 2009
@@ -113,7 +113,13 @@
 Optimizations
 -------------
 
-A few performance enhancements have been added:
+Several performance enhancements have been added:
+
+.. * A new :program:`configure` option, :option:`--with-computed-gotos`,
+   compiles the main bytecode interpreter loop using a new dispatch
+   mechanism that gives speedups of up to 20%, depending on the system
+   and benchmark.  The new mechanism is only supported on certain
+   compilers, such as gcc, SunPro, and icc.
 
 * The garbage collector now performs better when many objects are
   being allocated without deallocating any.  A full garbage collection
@@ -158,7 +164,7 @@
   (Contributed by Mark Dickinson; :issue:`4258`.)
 
   Another set of changes made long objects a few bytes smaller: 2 bytes
-  smaller on 32-bit systems and 6 bytes on 64-bit.  (:
+  smaller on 32-bit systems and 6 bytes on 64-bit.
   (Contributed by Mark Dickinson; :issue:`5260`.)
 
 * The division algorithm for long integers has been made faster
@@ -168,6 +174,10 @@
   integer divisions and modulo operations.
   (Contributed by Mark Dickinson; :issue:`5512`.)
 
+* List comprehensions with an ``if`` condition are compiled into
+  faster bytecode.  (Patch by Antoine Pitrou, back-ported to 2.7
+  by Jeffrey Yasskin; :issue:`4715`.)
+
 .. ======================================================================
 
 New, Improved, and Deprecated Modules
@@ -179,12 +189,6 @@
 :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.
 
-* 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 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: ...``.
   (Contributed by Hagen Fuerstenau; :issue:`3860`.)
@@ -224,7 +228,24 @@
   Contributed by Raymond Hettinger; :issue:`1696199`.
 
 * In Distutils, :func:`distutils.sdist.add_defaults` now uses
-  *package_dir* and *data_files* to feed MANIFEST.
+  *package_dir* and *data_files* to create the MANIFEST file.
+
+  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 Ziade,
+  with the initial contribution by Nathan Van Gheem; :issue:`4394`.)
+
+* New method: the :class:`Decimal` class gained a
+  :meth:`from_float` class method that performs an exact conversion
+  of a floating-point number to a :class:`Decimal`.
+  Note that this is an **exact** conversion that strives for the
+  closest decimal approximation to the floating-point representation's value;
+  the resulting decimal value will therefore still include the inaccuracy,
+  if any.
+  For example, ``Decimal.from_float(0.1)`` returns
+  ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
+  (Implemented by Raymond Hettinger; :issue:`4796`.)
 
 * A new function in the :mod:`gc` module, :func:`is_tracked`, returns
   True if a given instance is tracked by the garbage collector, False
@@ -233,6 +254,9 @@
 * 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`.)
+  It's now possible to override the modification time
+  recorded in a gzipped file by providing an optional timestamp to
+  the constructor.  (Contributed by Jacques Frechet; :issue:`4272`.)
 
 * The :class:`io.FileIO` class now raises an :exc:`OSError` when passed
   an invalid file descriptor.  (Implemented by Benjamin Peterson;
@@ -263,6 +287,11 @@
   floats or :class:`Decimal` instances.  (Implemented by Raymond
   Hettinger; :issue:`5032`.)
 
+  :func:`itertools.combinations` and :func:`itertools.product` were
+  previously raising :exc:`ValueError` for values of *r* larger than
+  the input iterable.  This was deemed a specification error, so they
+  now return an empty iterator.  (Fixed by Raymond Hettinger; :issue:`4816`.)
+
 * 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.
@@ -351,6 +380,11 @@
   is particularly useful for asynchronous IO operations.
   (Contributed by Kristjan Valur Jonsson; :issue:`4293`.)
 
+* The :program:`configure` script now checks for floating-point rounding bugs
+  on certain 32-bit Intel chips and defines a :cmacro:`X87_DOUBLE_ROUNDING`
+  preprocessor definition.  No code currently uses this definition,
+  but it's available if anyone wishes to use it.
+  (Added by Mark Dickinson; :issue:`2937`.)
 
 .. ======================================================================
 
@@ -373,10 +407,22 @@
 Port-Specific Changes: Mac OS X
 -----------------------------------
 
+* The ``/Library/Python/2.7/site-packages`` is now appended to
+  ``sys.path``, in order to share added packages between the system
+  installation and a user-installed copy of the same version.
+  (Changed by Ronald Oussoren; :issue:`4865`.)
+
 
 Other Changes and Fixes
 =======================
 
+* When importing a module from a :file:`.pyc` or :file:`.pyo` file
+  with an existing :file:`.py` counterpart, the :attr:`co_filename`
+  attributes of all code objects if the original filename is obsolete,
+  which can happen if the file has been renamed, moved, or is accessed
+  through different paths.  (Patch by Ziga Seilnacht and Jean-Paul
+  Calderone; :issue:`1180193`.)
+
 * 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.


More information about the Python-checkins mailing list