[issue5237] Allow auto-numbered replacement fields in str.format() strings
Eric Smith
report at bugs.python.org
Sat Mar 14 00:51:27 CET 2009
Eric Smith <eric at trueblade.com> added the comment:
I'm thinking of allowing you to mix keywords and auto-numbering, but not
manual numbering and auto-numbering. This would be so we could do:
>>> '{:{fmt}} {:{fmt}}'.format(3.1415, 2.71828, fmt='1.4f')
'pi=3.1415 e=2.7183'
Unfortunately the ':' is required, because if it's not there you have 2
braces next to each other, which is the escape sequence for a single brace.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5237>
_______________________________________
More information about the Python-bugs-list
mailing list