summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-08-15 09:43:29 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-08-15 09:43:29 (GMT)
commit8858d2cb84c30908302c533ba92a3c42dabefe04 (patch)
tree75f05d099373fc958fc861193df102cbb6ff5f48
parente039ffe41d82c45c1e8a1be2973b9b1125f727f7 (diff)
downloadcpython-8858d2cb84c30908302c533ba92a3c42dabefe04.zip
cpython-8858d2cb84c30908302c533ba92a3c42dabefe04.tar.gz
cpython-8858d2cb84c30908302c533ba92a3c42dabefe04.tar.bz2
Clarify whatsnew entry for short float repr: roundtripping is not a new feature in 2.7.
-rw-r--r--Doc/whatsnew/2.7.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index 5aa632a..b2725c9 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -143,10 +143,12 @@ A partial list of 3.1 features that were backported to 2.7:
* The :class:`memoryview` object.
* A small subset of the :mod:`importlib` module,
`described below <#importlib-section>`__.
-* Float-to-string and string-to-float conversions now round their
- results more correctly, and :func:`repr` of a floating-point
- number *x* returns a result that's guaranteed to round back to the
- same number when converted back to a float.
+* The :func:`repr` of a float ``x`` is shorter in many cases: it's now
+ based on the shortest decimal string that's guaranteed to round back
+ to ``x``. As in previous versions of Python, it's guaranteed that
+ ``float(repr(x))`` recovers ``x``.
+* Float-to-string and string-to-float conversions are correctly rounded.
+ The :func:`round` function is also now correctly rounded.
* The :ctype:`PyCapsule` type, used to provide a C API for extension modules.
* The :cfunc:`PyLong_AsLongAndOverflow` C API function.