Skip to content

Commit 09db1da

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 c6f9554 commit 09db1da

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
@@ -416,8 +416,9 @@ error.
416416
.. versionchanged:: 3.6
417417
Added the ``'_'`` option (see also :pep:`515`).
418418

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

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

0 commit comments

Comments
 (0)