
report at bugs
Aug 17, 2012, 12:13 PM
Post #4 of 6
(230 views)
Permalink
|
|
[issue15660] In str.format there is a misleading error message about alignment
[In reply to]
|
|
Terry J. Reedy added the comment: As I read the docs, the error message is correct and this issue is invalid as a behavior issue. I read the OP's second message as more or less saying this also. "'=' 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." "If the width field is preceded by a zero ('0') character, this enables zero-padding. This is equivalent to an alignment type of '=' and a fill character of '0'." So ":02" is equivalent to ":0=2", which is invalid. >>> '{:02d}'.format(1) '01' works fine. I decided make this a doc issue and add " for numeric types" after "this enables zero-padding" before closing this. ---------- assignee: -> docs [at] pytho components: +Documentation -Interpreter Core nosy: +docs [at] pytho, terry.reedy versions: +Python 2.7, Python 3.3 _______________________________________ Python tracker <report [at] bugs> <http://bugs.python.org/issue15660> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|