summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-10-20 23:53:30 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-10-20 23:53:30 (GMT)
commit632f1bfd3902e0b020ba697cdb7b31df7b2656d6 (patch)
tree8c725628b2a8053d3ae38235927f535e982c8272 /Doc
parent566a2be95c3aba65302d3d5b8108b27f810e1eaf (diff)
parentc31844257185f897d657bb8929f36f9c4e8888f2 (diff)
downloadcpython-632f1bfd3902e0b020ba697cdb7b31df7b2656d6.zip
cpython-632f1bfd3902e0b020ba697cdb7b31df7b2656d6.tar.gz
cpython-632f1bfd3902e0b020ba697cdb7b31df7b2656d6.tar.bz2
#19238, #19289: merge with 3.3.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/string.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index c92a005..e304c5d 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -293,18 +293,18 @@ The general form of a *standard format specifier* is:
.. productionlist:: sf
format_spec: [[`fill`]`align`][`sign`][#][0][`width`][,][.`precision`][`type`]
- fill: <a character other than '{' or '}'>
+ fill: <any character>
align: "<" | ">" | "=" | "^"
sign: "+" | "-" | " "
width: `integer`
precision: `integer`
type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
-The *fill* character can be any character other than '{' or '}'. The presence
-of a fill character is signaled by the character following it, which must be
-one of the alignment options. If the second character of *format_spec* is not
-a valid alignment option, then it is assumed that both the fill character and
-the alignment option are absent.
+If a valid *align* value is specified, it can be preceeded by a *fill*
+character that can be any character and defaults to a space if omitted.
+Note that it is not possible to use ``{`` and ``}`` as *fill* char while
+using the :meth:`str.format` method; this limitation however doesn't
+affect the :func:`format` function.
The meaning of the various alignment options is as follows: