[Python-checkins] bpo-38657: Clarify numeric padding behaviour in string formatting (GH-17036)

Miss Islington (bot) webhook-mailer at python.org
Fri Feb 21 01:06:05 EST 2020


https://github.com/python/cpython/commit/09db1da63f866afff8a64ae3c60acdcd6bc80501
commit: 09db1da63f866afff8a64ae3c60acdcd6bc80501
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-02-20T22:05:58-08:00
summary:

bpo-38657: Clarify numeric padding behaviour in string formatting (GH-17036)


Make the definition of the width more explicit that it includes any
extra signs added by other options.

https://bugs.python.org/issue38657

Automerge-Triggered-By: @Mariatta
(cherry picked from commit 424e5686d82235e08f8108b8bbe034bc91421689)

Co-authored-by: Pete Wicken <2273100+JamoBox at users.noreply.github.com>

files:
M Doc/library/string.rst

diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index bbbfed273ee45..6cbe54963196a 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -416,8 +416,9 @@ 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.
+*width* is a decimal integer defining the minimum total field width,
+including any prefixes, separators, and other formatting characters.
+If not specified, then the field width will be determined by the content.
 
 When no explicit alignment is given, preceding the *width* field by a zero
 (``'0'``) character enables



More information about the Python-checkins mailing list