summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2016-09-10 03:06:47 (GMT)
committerEric V. Smith <eric@trueblade.com>2016-09-10 03:06:47 (GMT)
commit89e1b1aae0775341735de6bc5e97b3c1e9cea0fa (patch)
treecadcc5860ce497d17783b2af9901d9bb71ee1820 /Doc
parent37d398ebd1b177001df231b9bba17429ac61ff12 (diff)
downloadcpython-89e1b1aae0775341735de6bc5e97b3c1e9cea0fa.zip
cpython-89e1b1aae0775341735de6bc5e97b3c1e9cea0fa.tar.gz
cpython-89e1b1aae0775341735de6bc5e97b3c1e9cea0fa.tar.bz2
Issue 27080: PEP 515: add '_' formatting option.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/string.rst12
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index c421c72..b5d5ed1 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -300,7 +300,7 @@ non-empty format string typically modifies the result.
The general form of a *standard format specifier* is:
.. productionlist:: sf
- format_spec: [[`fill`]`align`][`sign`][#][0][`width`][,][.`precision`][`type`]
+ format_spec: [[`fill`]`align`][`sign`][#][0][`width`][,][_][.`precision`][`type`]
fill: <any character>
align: "<" | ">" | "=" | "^"
sign: "+" | "-" | " "
@@ -378,6 +378,16 @@ instead.
.. versionchanged:: 3.1
Added the ``','`` option (see also :pep:`378`).
+The ``'_'`` option signals the use of an underscore for a thousands
+separator for floating point presentation types and for integer
+presentation type ``'d'``. For integer presentation types ``'b'``,
+``'o'``, ``'x'``, and ``'X'``, underscores will be inserted every 4
+digits. For other presentation types, specifying this option is an
+error.
+
+.. versionchanged:: 3.6
+ Added the ``'_'`` option (see also :pep:`515`).
+
*width* is a decimal integer defining the minimum field width. If not
specified, then the field width will be determined by the content.