Kaydet (Commit) 4a0661b4 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Add various items

üst 4e9830f7
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
.. Fix accents on Kristjan Valur Jonsson, Fuerstenau .. Fix accents on Kristjan Valur Jonsson, Fuerstenau
.. Big jobs: argparse, ElementTree 1.3, pep 391, 3106, sysconfig
.. unittest test discovery
.. $Id$ .. $Id$
Rules for maintenance: Rules for maintenance:
...@@ -237,6 +240,20 @@ PEP 391: Dictionary-Based Configuration For Logging ...@@ -237,6 +240,20 @@ PEP 391: Dictionary-Based Configuration For Logging
XXX write this section. XXX write this section.
Two smaller enhancements to the logging module are:
.. rev79293
* :class:`Logger` instances gained a :meth:`getChild` that retrieves a
descendant logger using a relative path. For example,
once you retrieve a logger by doing ``log = getLogger('app')``,
calling ``log.getChild('network.listen')`` is equivalent to
``getLogger('app.network.listen')``.
* The :class:`LoggerAdapter` class gained a :meth:`isEnabledFor` method
that takes a *level* and returns whether the underlying logger would
process a message of that level of importance.
.. seealso:: .. seealso::
:pep:`391` - Dictionary-Based Configuration For Logging :pep:`391` - Dictionary-Based Configuration For Logging
...@@ -351,11 +368,12 @@ Some smaller changes made to the core Python language are: ...@@ -351,11 +368,12 @@ Some smaller changes made to the core Python language are:
of them -- but you can mix auto-numbering and named fields, as in the second of them -- but you can mix auto-numbering and named fields, as in the second
example above. (Contributed by Eric Smith; :issue:`5237`.) example above. (Contributed by Eric Smith; :issue:`5237`.)
Complex numbers now correctly support usage with :func:`format`. Complex numbers now correctly support usage with :func:`format`,
and default to being right-aligned.
Specifying a precision or comma-separation applies to both the real Specifying a precision or comma-separation applies to both the real
and imaginary parts of the number, but a specified field width and and imaginary parts of the number, but a specified field width and
alignment is applied to the whole of the resulting ``1.5+3j`` alignment is applied to the whole of the resulting ``1.5+3j``
output. (Contributed by Eric Smith; :issue:`1588`.) output. (Contributed by Eric Smith; :issue:`1588` and :issue:`7988`.)
The 'F' format code now always formats its output using uppercase characters, The 'F' format code now always formats its output using uppercase characters,
so it will now produce 'INF' and 'NAN'. so it will now produce 'INF' and 'NAN'.
...@@ -406,6 +424,10 @@ Some smaller changes made to the core Python language are: ...@@ -406,6 +424,10 @@ Some smaller changes made to the core Python language are:
Integer division is also more accurate in its rounding behaviours. (Also Integer division is also more accurate in its rounding behaviours. (Also
implemented by Mark Dickinson; :issue:`1811`.) implemented by Mark Dickinson; :issue:`1811`.)
* It's now possible for a subclass of the built-in :class:`unicode` type
to override the :meth:`__unicode__` method. (Implemented by
Victor Stinner; :issue:`1583863`.)
* The :class:`bytearray` type's :meth:`translate` method now accepts * The :class:`bytearray` type's :meth:`translate` method now accepts
``None`` as its first argument. (Fixed by Georg Brandl; ``None`` as its first argument. (Fixed by Georg Brandl;
:issue:`4759`.) :issue:`4759`.)
...@@ -568,6 +590,14 @@ changes, or look through the Subversion logs for all the details. ...@@ -568,6 +590,14 @@ changes, or look through the Subversion logs for all the details.
used with :class:`memoryview` instances and other similar buffer objects. used with :class:`memoryview` instances and other similar buffer objects.
(Backported from 3.x by Florent Xicluna; :issue:`7703`.) (Backported from 3.x by Florent Xicluna; :issue:`7703`.)
* Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9
to version 4.8.4 of
`the pybsddb package <http://www.jcea.es/programacion/pybsddb.htm>`__.
The new version features better Python 3.x compatibility, various bug fixes,
and adds several new BerkeleyDB flags and methods.
(Updated by Jesús Cea Avion; :issue:`8156`. The pybsddb
changelog can be browsed at http://hg.jcea.es/pybsddb/file/tip/ChangeLog.)
* The :mod:`bz2` module's :class:`BZ2File` now supports the context * The :mod:`bz2` module's :class:`BZ2File` now supports the context
management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``. management protocol, so you can write ``with bz2.BZ2File(...) as f: ...``.
(Contributed by Hagen Fuerstenau; :issue:`3860`.) (Contributed by Hagen Fuerstenau; :issue:`3860`.)
...@@ -656,6 +686,11 @@ changes, or look through the Subversion logs for all the details. ...@@ -656,6 +686,11 @@ changes, or look through the Subversion logs for all the details.
``Decimal('0.1000000000000000055511151231257827021181583404541015625')``. ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``.
(Implemented by Raymond Hettinger; :issue:`4796`.) (Implemented by Raymond Hettinger; :issue:`4796`.)
Most of the methods of the :class:`Context` class now accept integers
as well as :class:`Decimal` instances; the only exceptions are the
:meth:`canonical` and :meth:`is_canonical` methods. (Patch by
Juan José Conti; :issue:`7633`.)
The constructor for :class:`Decimal` now accepts non-European The constructor for :class:`Decimal` now accepts non-European
Unicode characters, such as Arabic-Indic digits. (Contributed by Unicode characters, such as Arabic-Indic digits. (Contributed by
Mark Dickinson; :issue:`6595`.) Mark Dickinson; :issue:`6595`.)
...@@ -697,6 +732,12 @@ changes, or look through the Subversion logs for all the details. ...@@ -697,6 +732,12 @@ changes, or look through the Subversion logs for all the details.
:mod:`gzip` module will now consume these trailing bytes. (Fixed by :mod:`gzip` module will now consume these trailing bytes. (Fixed by
Tadek Pietraszek and Brian Curtin; :issue:`2846`.) Tadek Pietraszek and Brian Curtin; :issue:`2846`.)
* New attribute: the :mod:`hashlib` module now has an :attr:`algorithms`
attribute containing a tuple naming the supported algorithms.
In Python 2.7, ``hashlib.algorithms`` contains
``('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')``
(Contributed by Carl Chenet; :issue:`7418`.)
* The default :class:`HTTPResponse` class used by the :mod:`httplib` module now * The default :class:`HTTPResponse` class used by the :mod:`httplib` module now
supports buffering, resulting in much faster reading of HTTP responses. supports buffering, resulting in much faster reading of HTTP responses.
(Contributed by Kristjan Valur Jonsson; :issue:`4879`.) (Contributed by Kristjan Valur Jonsson; :issue:`4879`.)
...@@ -803,9 +844,11 @@ changes, or look through the Subversion logs for all the details. ...@@ -803,9 +844,11 @@ changes, or look through the Subversion logs for all the details.
the child process; this fixes problems on Solaris when :func:`fork` the child process; this fixes problems on Solaris when :func:`fork`
is called from a thread. (Fixed by Zsolt Cserna; :issue:`7242`.) is called from a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)
The :func:`normpath` function now preserves Unicode; if its input path * In the :mod:`os.path` module, the :func:`normpath` and
:func:`abspath` functions now preserve Unicode; if their input path
is a Unicode string, the return value is also a Unicode string. is a Unicode string, the return value is also a Unicode string.
(Fixed by Matt Giuca; :issue:`5827`.) (:meth:`normpath` fixed by Matt Giuca in :issue:`5827`;
:meth:`abspath` fixed by Ezio Melotti in :issue:`3426`.)
* 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.
...@@ -940,14 +983,13 @@ changes, or look through the Subversion logs for all the details. ...@@ -940,14 +983,13 @@ changes, or look through the Subversion logs for all the details.
a timeout was provided and the operation timed out. a timeout was provided and the operation timed out.
(Contributed by Tim Lesher; :issue:`1674032`.) (Contributed by Tim Lesher; :issue:`1674032`.)
* The Unicode database has been updated to the version 5.2.0. * The Unicode database provided by the :mod:`unicodedata` module is
(Updated by Florent Xicluna; :issue:`8024`.) now used internally to determine which characters are numeric,
whitespace, or represent line breaks. The database also
* The Unicode database provided by the :mod:`unicodedata` is used includes information from the :file:`Unihan.txt` data file (patch
internally to determine which characters are numeric, whitespace, by Anders Chrigström and Amaury Forgeot d'Arc; :issue:`1571184`)
or represent line breaks. The database also now includes information and has been updated to version 5.2.0 (updated by
from the :file:`Unihan.txt` data file. (Patch by Anders Chrigström Florent Xicluna; :issue:`8024`).
and Amaury Forgeot d'Arc; :issue:`1571184`.)
* The :class:`UserDict` class is now a new-style class. (Changed by * The :class:`UserDict` class is now a new-style class. (Changed by
Benjamin Peterson.) Benjamin Peterson.)
...@@ -1074,12 +1116,22 @@ object to run. For example, you can write this:: ...@@ -1074,12 +1116,22 @@ object to run. For example, you can write this::
(Implemented by Antoine Pitrou; :issue:`4444`.) (Implemented by Antoine Pitrou; :issue:`4444`.)
.. rev 78774
Module- and class-level setup and teardown fixtures are now supported.
Modules can contain :func:`setUpModule` and :func:`tearDownModule`
functions. Classes can have :meth:`setUpClass` and
:meth:`tearDownClass` methods that must be defined as class methods
(using ``@classmethod`` or the equivalent). These functions and
methods are invoked when the test runner switches to a test case in a
different module or class.
The methods :meth:`addCleanup` and :meth:`doCleanups` were added. The methods :meth:`addCleanup` and :meth:`doCleanups` were added.
:meth:`addCleanup` allows you to add cleanup functions that :meth:`addCleanup` allows you to add cleanup functions that
will be called unconditionally (after :meth:`setUp` if will be called unconditionally (after :meth:`setUp` if
:meth:`setUp` fails, otherwise after :meth:`tearDown`). This allows :meth:`setUp` fails, otherwise after :meth:`tearDown`). This allows
for much simpler resource allocation and deallocation during tests. for much simpler resource allocation and deallocation during tests
:issue:`5679` (:issue:`5679`).
A number of new methods were added that provide more specialized A number of new methods were added that provide more specialized
tests. Many of these methods were written by Google engineers tests. Many of these methods were written by Google engineers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment