Eric Smith <e...@trueblade.com> added the comment: Okay, one last version. This one lets you use object access within the replacement string:
>>> from auto_number_formatter_3 import formatter as _ >>> _('{} {} {}').format(3, 'pi', 3.14) '3 pi 3.14' >>> _('{:#b} {!r:^10} {.imag}').format(3, 'pi', 3j+1) "0b11 'pi' 3.0" So not it lets you add in format specifiers, conversion specifiers, and object access. At this point the improvement of leaving out the index numbers is less clear. I'll leave it for debate if this is useful. I think it probably is, if only because it's easier to explain the behavior: If you leave out the 'field name', a sequential number is added in front of the 'replacement string' (using PEP 3101 nomenclature). Added file: http://bugs.python.org/file13082/auto_number_formatter_3.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5237> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com