summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-10-24 14:01:08 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-10-24 14:01:08 (GMT)
commitda8652d920210a5ff783a7ad30f4c24d2b5ff2a2 (patch)
tree4637c39f07fcd7781d2326c4ec0a11370a089040 /Doc/library/sys.rst
parent99abd145dc88b1e240e55e34d9a89b7dd2360d2c (diff)
downloadcpython-da8652d920210a5ff783a7ad30f4c24d2b5ff2a2.zip
cpython-da8652d920210a5ff783a7ad30f4c24d2b5ff2a2.tar.gz
cpython-da8652d920210a5ff783a7ad30f4c24d2b5ff2a2.tar.bz2
Issue #7117 (backport py3k float repr) continued:
Add sys.float_repr_style attribute ('short' if short float repr is in used; 'legacy' otherwise).
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 8264a39..5a04f39 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -332,6 +332,18 @@ always available.
.. versionadded:: 2.6
+.. data:: float_repr_style
+
+ A string indicating how the :func:`repr` function behaves for
+ floats. If the string has value ``'short'`` then for a finite
+ float ``x``, ``repr(x)`` aims to produce a short string with the
+ property that ``float(repr(x)) == x``. This is the usual behaviour
+ in Python 2.7 and later. Otherwise, ``float_repr_style`` has value
+ ``'legacy'`` and ``repr(x)`` behaves in the same way as it did in
+ versions of Python prior to 2.7.
+
+ .. versionadded:: 2.7
+
.. function:: getcheckinterval()