Skip to content

Commit a207512

Browse files
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 424e568) Co-authored-by: Pete Wicken <[email protected]>
1 parent b627102 commit a207512

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/string.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,9 @@ error.
415415
.. versionchanged:: 3.6
416416
Added the ``'_'`` option (see also :pep:`515`).
417417

418-
*width* is a decimal integer defining the minimum field width. If not
419-
specified, then the field width will be determined by the content.
418+
*width* is a decimal integer defining the minimum total field width,
419+
including any prefixes, separators, and other formatting characters.
420+
If not specified, then the field width will be determined by the content.
420421

421422
When no explicit alignment is given, preceding the *width* field by a zero
422423
(``'0'``) character enables

0 commit comments

Comments
 (0)