summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-03-21 01:05:50 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-03-21 01:05:50 (GMT)
commit127f0d85e4d8e03bbc97bcd296c037880cd3531a (patch)
tree6cf2d8f1dbe59d6c9c2e1d6ffbe1192113a96e18 /Doc/library
parent9d9d99cbee34002afcbe6f2a0b4779c6714477b6 (diff)
downloadcpython-127f0d85e4d8e03bbc97bcd296c037880cd3531a.zip
cpython-127f0d85e4d8e03bbc97bcd296c037880cd3531a.tar.gz
cpython-127f0d85e4d8e03bbc97bcd296c037880cd3531a.tar.bz2
Issue #15660: Further clarify 0 prefix for width specifier in formats.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/string.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index af13ee4..260cd0a 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -353,7 +353,8 @@ The meaning of the various alignment options is as follows:
| ``'='`` | Forces the padding to be placed after the sign (if any) |
| | but before the digits. This is used for printing fields |
| | in the form '+000000120'. This alignment option is only |
- | | valid for numeric types. |
+ | | valid for numeric types. It becomes the default when '0'|
+ | | immediately precedes the field width. |
+---------+----------------------------------------------------------+
| ``'^'`` | Forces the field to be centered within the available |
| | space. |
@@ -393,7 +394,8 @@ instead.
*width* is a decimal integer defining the minimum field width. If not
specified, then the field width will be determined by the content.
-Preceding the *width* field by a zero (``'0'``) character enables
+When no explicit alignment is given, preceding the *width* field by a zero
+(``'0'``) character enables
sign-aware zero-padding for numeric types. This is equivalent to a *fill*
character of ``'0'`` with an *alignment* type of ``'='``.