summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew/3.1.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-04-09 00:08:24 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-04-09 00:08:24 (GMT)
commit35a88363a5a76872699763bef51e7ef628b855e9 (patch)
tree8f1ce8e9f9afe9d2d71995887955b3b201df6613 /Doc/whatsnew/3.1.rst
parent2a39e0f98e915a6c53dce051a0fc02e5fd25f018 (diff)
downloadcpython-35a88363a5a76872699763bef51e7ef628b855e9.zip
cpython-35a88363a5a76872699763bef51e7ef628b855e9.tar.gz
cpython-35a88363a5a76872699763bef51e7ef628b855e9.tar.bz2
Update whatsnew based on doc search.
Diffstat (limited to 'Doc/whatsnew/3.1.rst')
-rw-r--r--Doc/whatsnew/3.1.rst51
1 files changed, 49 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.1.rst b/Doc/whatsnew/3.1.rst
index 7ada5dd..56169a2 100644
--- a/Doc/whatsnew/3.1.rst
+++ b/Doc/whatsnew/3.1.rst
@@ -233,6 +233,16 @@ New, Improved, and Deprecated Modules
(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
now supports the execution of packages by looking for and executing
a ``__main__`` submodule when a package name is supplied.
@@ -269,7 +279,30 @@ New, Improved, and Deprecated Modules
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,
pure Python reference implementation of the *import* statement and its
@@ -319,7 +352,13 @@ Major performance enhancements have been added:
its performance. The code is expected to be added in-time for the beta
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
2**30, the base being determined at build time. Previously, they
@@ -342,3 +381,11 @@ Major performance enhancements have been added:
(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`.)