summaryrefslogtreecommitdiff
path: root/Doc/library/string.rst
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2016-09-09 23:06:47 -0400
committerEric V. Smith <eric@trueblade.com>2016-09-09 23:06:47 -0400
commit89e1b1aae0775341735de6bc5e97b3c1e9cea0fa (patch)
treecadcc5860ce497d17783b2af9901d9bb71ee1820 /Doc/library/string.rst
parent37d398ebd1b177001df231b9bba17429ac61ff12 (diff)
downloadcpython-git-89e1b1aae0775341735de6bc5e97b3c1e9cea0fa.tar.gz
Issue 27080: PEP 515: add '_' formatting option.
Diffstat (limited to 'Doc/library/string.rst')
-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 c421c72d75..b5d5ed1901 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.