Commit 35a88363 authored by Raymond Hettinger's avatar Raymond Hettinger

Update whatsnew based on doc search.

parent 2a39e0f9
...@@ -279,7 +279,7 @@ I/O Base Classes ...@@ -279,7 +279,7 @@ I/O Base Classes
Return the new absolute position. Return the new absolute position.
.. versionadded:: 2.7 .. versionadded:: 3.1
The ``SEEK_*`` constants The ``SEEK_*`` constants
.. method:: seekable() .. method:: seekable()
......
...@@ -841,7 +841,7 @@ object -- see :ref:`multiprocessing-managers`. ...@@ -841,7 +841,7 @@ object -- see :ref:`multiprocessing-managers`.
will always return ``True`` except if a timeout is given and the operation will always return ``True`` except if a timeout is given and the operation
times out. times out.
.. versionchanged:: 2.7 .. versionchanged:: 3.1
Previously, the method always returned ``None``. Previously, the method always returned ``None``.
.. class:: Lock() .. class:: Lock()
......
...@@ -833,7 +833,7 @@ always available. ...@@ -833,7 +833,7 @@ always available.
so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major`` so ``sys.version_info[0]`` is equivalent to ``sys.version_info.major``
and so on. and so on.
.. versionchanged:: 2.7 .. versionchanged:: 3.1
Added named component attributes Added named component attributes
.. data:: warnoptions .. data:: warnoptions
......
...@@ -687,7 +687,7 @@ An event object manages an internal flag that can be set to true with the ...@@ -687,7 +687,7 @@ An event object manages an internal flag that can be set to true with the
This method returns the internal flag on exit, so it will always return This method returns the internal flag on exit, so it will always return
``True`` except if a timeout is given and the operation times out. ``True`` except if a timeout is given and the operation times out.
.. versionchanged:: 2.7 .. versionchanged:: 3.1
Previously, the method always returned ``None``. Previously, the method always returned ``None``.
......
...@@ -611,7 +611,7 @@ Test cases ...@@ -611,7 +611,7 @@ Test cases
Signal a test failure if *expr* is false; the explanation for the error Signal a test failure if *expr* is false; the explanation for the error
will be *msg* if given, otherwise it will be :const:`None`. will be *msg* if given, otherwise it will be :const:`None`.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failUnless`. :meth:`failUnless`.
...@@ -630,10 +630,10 @@ Test cases ...@@ -630,10 +630,10 @@ Test cases
registers :meth:`addTypeEqualityFunc` the type specific equality function registers :meth:`addTypeEqualityFunc` the type specific equality function
will be called in order to generate a more useful default error message. will be called in order to generate a more useful default error message.
.. versionchanged:: 2.7 .. versionchanged:: 3.1
Added the automatic calling of type specific equality function. Added the automatic calling of type specific equality function.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failUnlessEqual`. :meth:`failUnlessEqual`.
...@@ -647,7 +647,7 @@ Test cases ...@@ -647,7 +647,7 @@ Test cases
default value for *msg* can be computed to include representations of both default value for *msg* can be computed to include representations of both
*first* and *second*. *first* and *second*.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failIfEqual`. :meth:`failIfEqual`.
...@@ -663,7 +663,7 @@ Test cases ...@@ -663,7 +663,7 @@ Test cases
compare equal, the test will fail with the explanation given by *msg*, or compare equal, the test will fail with the explanation given by *msg*, or
:const:`None`. :const:`None`.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failUnlessAlmostEqual`. :meth:`failUnlessAlmostEqual`.
...@@ -679,7 +679,7 @@ Test cases ...@@ -679,7 +679,7 @@ Test cases
compare equal, the test will fail with the explanation given by *msg*, or compare equal, the test will fail with the explanation given by *msg*, or
:const:`None`. :const:`None`.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failIfAlmostEqual`. :meth:`failIfAlmostEqual`.
...@@ -695,7 +695,7 @@ Test cases ...@@ -695,7 +695,7 @@ Test cases
>>> self.assertGreaterEqual(3, 4) >>> self.assertGreaterEqual(3, 4)
AssertionError: "3" unexpectedly not greater than or equal to "4" AssertionError: "3" unexpectedly not greater than or equal to "4"
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertMultiLineEqual(self, first, second, msg=None) .. method:: assertMultiLineEqual(self, first, second, msg=None)
...@@ -706,7 +706,7 @@ Test cases ...@@ -706,7 +706,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertRegexpMatches(text, regexp[, msg=None]): .. method:: assertRegexpMatches(text, regexp[, msg=None]):
...@@ -716,7 +716,7 @@ Test cases ...@@ -716,7 +716,7 @@ Test cases
a regular expression object or a string containing a regular expression a regular expression object or a string containing a regular expression
suitable for use by :func:`re.search`. suitable for use by :func:`re.search`.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertIn(first, second, msg=None) .. method:: assertIn(first, second, msg=None)
...@@ -727,7 +727,7 @@ Test cases ...@@ -727,7 +727,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertSameElements(expected, actual, msg=None) .. method:: assertSameElements(expected, actual, msg=None)
...@@ -738,7 +738,7 @@ Test cases ...@@ -738,7 +738,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertSetEqual(set1, set2, msg=None) .. method:: assertSetEqual(set1, set2, msg=None)
...@@ -751,7 +751,7 @@ Test cases ...@@ -751,7 +751,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertDictEqual(expected, actual, msg=None) .. method:: assertDictEqual(expected, actual, msg=None)
...@@ -761,7 +761,7 @@ Test cases ...@@ -761,7 +761,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertDictContainsSubset(expected, actual, msg=None) .. method:: assertDictContainsSubset(expected, actual, msg=None)
...@@ -772,7 +772,7 @@ Test cases ...@@ -772,7 +772,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertListEqual(list1, list2, msg=None) .. method:: assertListEqual(list1, list2, msg=None)
...@@ -784,7 +784,7 @@ Test cases ...@@ -784,7 +784,7 @@ Test cases
If specified *msg* will be used as the error message on failure. If specified *msg* will be used as the error message on failure.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertSequenceEqual(seq1, seq2, msg=None, seq_type=None) .. method:: assertSequenceEqual(seq1, seq2, msg=None, seq_type=None)
...@@ -799,7 +799,7 @@ Test cases ...@@ -799,7 +799,7 @@ Test cases
This method is used to implement :meth:`assertListEqual` and This method is used to implement :meth:`assertListEqual` and
:meth:`assertTupleEqual`. :meth:`assertTupleEqual`.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertRaises(exception[, callable, ...]) .. method:: assertRaises(exception[, callable, ...])
...@@ -821,7 +821,7 @@ Test cases ...@@ -821,7 +821,7 @@ Test cases
.. versionchanged:: 3.1 .. versionchanged:: 3.1
Added the ability to use :meth:`assertRaises` as a context manager. Added the ability to use :meth:`assertRaises` as a context manager.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failUnlessRaises`. :meth:`failUnlessRaises`.
...@@ -840,14 +840,14 @@ Test cases ...@@ -840,14 +840,14 @@ Test cases
with self.assertRaisesRegexp(ValueError, 'literal'): with self.assertRaisesRegexp(ValueError, 'literal'):
int('XYZ') int('XYZ')
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertIsNone(expr[, msg]) .. method:: assertIsNone(expr[, msg])
This signals a test failure if *expr* is not None. This signals a test failure if *expr* is not None.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertIsNotNone(expr[, msg]) .. method:: assertIsNotNone(expr[, msg])
...@@ -855,7 +855,7 @@ Test cases ...@@ -855,7 +855,7 @@ Test cases
The inverse of the :meth:`assertIsNone` method. The inverse of the :meth:`assertIsNone` method.
This signals a test failure if *expr* is None. This signals a test failure if *expr* is None.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. method:: assertFalse(expr[, msg]) .. method:: assertFalse(expr[, msg])
...@@ -865,7 +865,7 @@ Test cases ...@@ -865,7 +865,7 @@ Test cases
This signals a test failure if *expr* is true, with *msg* or :const:`None` This signals a test failure if *expr* is true, with *msg* or :const:`None`
for the error message. for the error message.
.. deprecated:: 2.7 .. deprecated:: 3.1
:meth:`failIf`. :meth:`failIf`.
...@@ -899,7 +899,7 @@ Test cases ...@@ -899,7 +899,7 @@ Test cases
The class setting can be overridden in individual tests by assigning an The class setting can be overridden in individual tests by assigning an
instance attribute to True or False before calling the assert methods. instance attribute to True or False before calling the assert methods.
.. versionadded:: 2.7 .. versionadded:: 3.1
Testing frameworks can use the following methods to collect information on Testing frameworks can use the following methods to collect information on
...@@ -936,7 +936,7 @@ Test cases ...@@ -936,7 +936,7 @@ Test cases
returns the first line of the test method's docstring, if available, returns the first line of the test method's docstring, if available,
along with the method name. along with the method name.
.. versionchanged:: 2.7 .. versionchanged:: 3.1
In earlier versions this only returned the first line of the test In earlier versions this only returned the first line of the test
method's docstring, if available or the :const:`None`. That led to method's docstring, if available or the :const:`None`. That led to
...@@ -958,7 +958,7 @@ Test cases ...@@ -958,7 +958,7 @@ Test cases
is to raise self.failureException with an error message useful is to raise self.failureException with an error message useful
for debugging the by explaining the inequalities in detail. for debugging the by explaining the inequalities in detail.
.. versionadded:: 2.7 .. versionadded:: 3.1
.. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]]) .. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]])
......
...@@ -233,6 +233,16 @@ New, Improved, and Deprecated Modules ...@@ -233,6 +233,16 @@ New, Improved, and Deprecated Modules
(Contributed by Gregory Smith.) (Contributed by Gregory Smith.)
* The :mod:`logging` module now implements a simple :class:`NullHandler`
class for applications that are not using logging but are calling
library code that does. Setting-up a null handler will suppress
spurious warnings like "No handlers could be found for logger X.Y.Z"::
>>> h = logging.NullHandler()
>>> logging.getLogger("foo").addHandler(h)
(Contributed by Vinay Sajip; issue:`4384`).
* The :mod:`runpy` module which supports the ``-m`` command line switch * The :mod:`runpy` module which supports the ``-m`` command line switch
now supports the execution of packages by looking for and executing now supports the execution of packages by looking for and executing
a ``__main__`` submodule when a package name is supplied. a ``__main__`` submodule when a package name is supplied.
...@@ -269,7 +279,30 @@ New, Improved, and Deprecated Modules ...@@ -269,7 +279,30 @@ New, Improved, and Deprecated Modules
def test_gimzo_without_required_library(self): def test_gimzo_without_required_library(self):
... ...
(Contributed by Benjamin Peterson.) Also, tests for exceptions have been builtout to work with context managers::
def test_division_by_zero(self):
with self.assertRaises(ZeroDivisionError):
x / 0
In addition, several new assertion methods were added including
:func:`assertSetEqual`, :func:`assertDictEqual`,
:func:`assertDictContainsSubset`, :func:`assertListEqual`,
:func:`assertTupleEqual`, :func:`assertSequenceEqual`,
:func:`assertRaisesRegexp`, :func:`assertIsNone`,
and :func:`assertIsNotNot`.
(Contributed by Benjamin Peterson and Antoine Pitrou.)
* The :mod:`io` module has three new constants for :meth:`seek`:
method :data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`.
* The :attr:`sys.version_info` tuple is now a named tuple::
>>> sys.version_info
sys.version_info(major=3, minor=1, micro=0, releaselevel='alpha', serial=2)
(Contributed by Ross Light; :issue:`4285`.)
* A new module, :mod:`importlib` was added. It provides a complete, portable, * A new module, :mod:`importlib` was added. It provides a complete, portable,
pure Python reference implementation of the *import* statement and its pure Python reference implementation of the *import* statement and its
...@@ -319,7 +352,13 @@ Major performance enhancements have been added: ...@@ -319,7 +352,13 @@ Major performance enhancements have been added:
its performance. The code is expected to be added in-time for the beta its performance. The code is expected to be added in-time for the beta
release. release.
(Contributed by Bob Ippolito.) (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou;
:issue:`4136`.)
Build and C API Changes
=======================
Changes to Python's build process and to the C API include:
* Integers are now stored internally either in base 2**15 or in base * Integers are now stored internally either in base 2**15 or in base
2**30, the base being determined at build time. Previously, they 2**30, the base being determined at build time. Previously, they
...@@ -342,3 +381,11 @@ Major performance enhancements have been added: ...@@ -342,3 +381,11 @@ Major performance enhancements have been added:
(Contributed by Mark Dickinson; :issue:`4258`.) (Contributed by Mark Dickinson; :issue:`4258`.)
* The :cfunc:`PyLong_AsUnsignedLongLong()` function now handles a negative
*pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`.
(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)
* Deprecated :cfunc:`PyNumber_Int`. Use :cfunc:`PyNumber_Long` instead.
(Contributed by Mark Dickinson; :issue;`4910`.)
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