[issue5237] Allow auto-numbered replacement fields in str.format() strings
Eric Smith
report at bugs.python.org
Fri Feb 13 14:30:12 CET 2009
Eric Smith <eric at trueblade.com> added the comment:
The attached file is a mostly working version that inherits from
string.Formatter. It has the following shortcomings, which would all be
addressed if we go forward:
- Doesn't handle escaping '{' or '}'
- Doesn't handle conversion specifiers, like '!s'
These are all a function of me being too lazy to write a complete
parser. If anyone really wants them, I could add them. But this is just
a proof of concept.
Admittedly this isn't a drop-in replacement for ''.format(), but it
should give a taste of what using it would be like.
Added file: http://bugs.python.org/file13067/auto_number_formatter.py
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5237>
_______________________________________
More information about the Python-bugs-list
mailing list