New submission from py.user <[email protected]>:
http://docs.python.org/py3k/library/string.html#format-specification-mini-language
"The fill character can be any character other than ‘{‘ or ‘}’. 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."
>>> '{0:x>10d}'.format(1)
'xxxxxxxxx1'
>>> '{0:xx10d}'.format(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid conversion specification
>>>
----------
messages: 151505
nosy: py.user
priority: normal
severity: normal
status: open
title: In str.format an incorrect alignment option doesn't make fill char and
onself absent
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13811>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com