Issue 19238: Misleading explanation of fill and align in format_spec (original) (raw)

Created on 2013-10-12 22:27 by davidchambers, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue19238.diff ezio.melotti,2013-10-20 23:35 review
Messages (9)
msg199633 - (view) Author: David Chambers (davidchambers) Date: 2013-10-12 22:27
From http://docs.python.org/3/library/string.html#formatspec: > 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. The fact that the second character in the format_spec is not an alignment option is not sufficient to declare that the alignment option is absent: the alignment option may be the first character in the format_spec. For example: >>> '{:^10}'.format(42) ' 42 ' I suggest the following wording: The presence of a fill character is signaled by the character following it, which must be one of the alignment options. Unless the second character of format_spec is a valid alignment option, the fill character is assumed to be absent.
msg200332 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2013-10-18 23:36
See also issue 19289.
msg200652 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-10-20 23:35
Here's a patch. This also include a fix for #19289.
msg200654 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2013-10-20 23:40
Looks good to me. Thanks!
msg200657 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-20 23:54
New changeset e3ff2065c548 by Ezio Melotti in branch '3.3': #19238, #19289: fix description of the align and fill values of the format specification. http://hg.python.org/cpython/rev/e3ff2065c548 New changeset f52892642c15 by Ezio Melotti in branch 'default': #19238, #19289: merge with 3.3. http://hg.python.org/cpython/rev/f52892642c15 New changeset 0592dc076bb7 by Ezio Melotti in branch '2.7': #19238, #19289: fix description of the align and fill values of the format specification. http://hg.python.org/cpython/rev/0592dc076bb7
msg200659 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-10-20 23:55
Fixed, thanks for the review!
msg202605 - (view) Author: David Chambers (davidchambers) Date: 2013-11-11 05:51
These commits contain a typo: s/preceeded/preceded/
msg203113 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-17 00:47
New changeset 2b0690c9a026 by Ezio Melotti in branch '2.7': #19238: fix typo in documentation. http://hg.python.org/cpython/rev/2b0690c9a026 New changeset 7e3f8026ed30 by Ezio Melotti in branch '3.3': #19238: fix typo in documentation. http://hg.python.org/cpython/rev/7e3f8026ed30 New changeset 829b95824867 by Ezio Melotti in branch 'default': #19238: merge with 3.3. http://hg.python.org/cpython/rev/829b95824867
msg203114 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-11-17 00:48
Fixed, thanks for noticing!
History
Date User Action Args
2022-04-11 14:57:51 admin set github: 63437
2013-11-17 00:48:33 ezio.melotti set messages: +
2013-11-17 00:47:51 python-dev set messages: +
2013-11-11 05:51:38 davidchambers set messages: +
2013-10-20 23:55:27 ezio.melotti set status: open -> closedmessages: + assignee: docs@python -> ezio.melottiresolution: fixedstage: patch review -> resolved
2013-10-20 23:54:33 python-dev set nosy: + python-devmessages: +
2013-10-20 23:40:30 eric.smith set messages: +
2013-10-20 23:35:34 ezio.melotti set files: + issue19238.diffkeywords: + patchmessages: + stage: patch review
2013-10-19 05:15:46 ezio.melotti set nosy: + ezio.melottitype: enhancement
2013-10-18 23:36:35 eric.smith set messages: +
2013-10-18 23:07:17 terry.reedy set nosy: + terry.reedyversions: + Python 2.7, Python 3.3, Python 3.4
2013-10-12 23:31:20 ned.deily set nosy: + eric.smith
2013-10-12 22:27:49 davidchambers create