summaryrefslogtreecommitdiff
path: root/Doc/library/string.rst
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-28 09:43:32 -0700
committerSerhiy Storchaka <storchaka@gmail.com>2018-10-28 18:43:32 +0200
commitfdf48b6b88f44a3ae6dc3e5eaea40c226c7df6c7 (patch)
tree549cbff8bdb4d999028a5db3aefffc2594ea4abd /Doc/library/string.rst
parentc516dc6e57341f24d2494514c650f4a240c1c95f (diff)
downloadcpython-git-fdf48b6b88f44a3ae6dc3e5eaea40c226c7df6c7.tar.gz
bpo-35054: Add yet more index entries for symbols. (GH-10121) (GH-10171)
(cherry picked from commit 913876d824d969f8c7431e8a9d4610a9a11a786e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r--Doc/library/string.rst32
1 files changed, 15 insertions, 17 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 55913f8c07..7ed52ab477 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -193,13 +193,11 @@ related to that of :ref:`formatted string literals <f-strings>`, but
there are differences.
.. index::
- single: {; in string formatting
- single: }; in string formatting
- single: .; in string formatting
- single: [; in string formatting
- single: ]; in string formatting
- single: !; in string formatting
- single: :; in string formatting
+ single: {} (curly brackets); in string formatting
+ single: . (dot); in string formatting
+ single: [] (square brackets); in string formatting
+ single: ! (exclamation); in string formatting
+ single: : (colon); in string formatting
Format strings contain "replacement fields" surrounded by curly braces ``{}``.
Anything that is not contained in braces is considered literal text, which is
@@ -333,10 +331,10 @@ affect the :func:`format` function.
The meaning of the various alignment options is as follows:
.. index::
- single: <; in string formatting
- single: >; in string formatting
- single: =; in string formatting
- single: ^; in string formatting
+ single: < (less); in string formatting
+ single: > (greater); in string formatting
+ single: = (equals); in string formatting
+ single: ^ (caret); in string formatting
+---------+----------------------------------------------------------+
| Option | Meaning |
@@ -365,8 +363,8 @@ The *sign* option is only valid for number types, and can be one of the
following:
.. index::
- single: +; in string formatting
- single: -; in string formatting
+ single: + (plus); in string formatting
+ single: - (minus); in string formatting
single: space; in string formatting
+---------+----------------------------------------------------------+
@@ -383,7 +381,7 @@ following:
+---------+----------------------------------------------------------+
-.. index:: single: #; in string formatting
+.. index:: single: # (hash); in string formatting
The ``'#'`` option causes the "alternate form" to be used for the
conversion. The alternate form is defined differently for different
@@ -397,7 +395,7 @@ decimal-point character appears in the result of these conversions
only if a digit follows it. In addition, for ``'g'`` and ``'G'``
conversions, trailing zeros are not removed from the result.
-.. index:: single: ,; in string formatting
+.. index:: single: , (comma); in string formatting
The ``','`` option signals the use of a comma for a thousands separator.
For a locale aware separator, use the ``'n'`` integer presentation type
@@ -406,7 +404,7 @@ instead.
.. versionchanged:: 3.1
Added the ``','`` option (see also :pep:`378`).
-.. index:: single: _; in string formatting
+.. index:: single: _ (underscore); in string formatting
The ``'_'`` option signals the use of an underscore for a thousands
separator for floating point presentation types and for integer
@@ -694,7 +692,7 @@ formatting facilities in Python. As an example of a library built on template
strings for i18n, see the
`flufl.i18n <http://flufli18n.readthedocs.io/en/latest/>`_ package.
-.. index:: single: $; in template strings
+.. index:: single: $ (dollar); in template strings
Template strings support ``$``-based substitutions, using the following rules: