[issue5237] Allow auto-numbered replacement fields in str.format() strings

Antoine Pitrou report at bugs.python.org
Fri Feb 13 15:09:44 CET 2009


Antoine Pitrou <pitrou at free.fr> added the comment:

Unfortunately, `'{d}{s}{f}'.format(3, 'foo', 3.14)` can't work as you
expect it to, because it already means "display the keyword arguments
named `d`, `s` and `f`.

(I agree that the syntax for format() strings is exceedingly tedious)

On the other hand, `'{:d}{:s}{:f}'.format(3, 'foo', 3.14)` should be
possible.

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5237>
_______________________________________


More information about the Python-bugs-list mailing list