Message115678
According to the documentation:
"The fill character can be any character other than ‘}’ (which signifies the end of the field)."
http://docs.python.org/dev/library/string.html#format-specification-mini-language
However the format() builtin accepts both '{' and '}' characters:
>>> format(42, '}^6')
'}}42}}'
>>> format(42, '{^6')
'{{42{{'
And the string method rejects both characters.
>>> '{:}^6}'.format(42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Single '}' encountered in format string
>>> '{:{^6}'.format(42)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: unmatched '{' in format |
|
Date |
User |
Action |
Args |
2010-09-06 00:11:23 | flox | set | recipients:
+ flox, docs@python |
2010-09-06 00:11:23 | flox | set | messageid: <1283731883.01.0.461973913755.issue9780@psf.upfronthosting.co.za> |
2010-09-06 00:11:20 | flox | link | issue9780 messages |
2010-09-06 00:11:19 | flox | create | |
|