Author eric.smith
Recipients LambertDW, eric.smith, ezio.melotti, mark.dickinson, pitrou, terry.reedy
Date 2009-02-14.10:28:58
SpamBayes Score 1.86122e-05
Marked as misclassified No
Message-id <1234607468.23.0.535527595034.issue5237@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2009-02-14 10:31:09eric.smithsetrecipients: + eric.smith, terry.reedy, mark.dickinson, pitrou, LambertDW, ezio.melotti
2009-02-14 10:31:08eric.smithsetmessageid: <1234607468.23.0.535527595034.issue5237@psf.upfronthosting.co.za>
2009-02-14 10:31:06eric.smithlinkissue5237 messages
2009-02-14 10:30:54eric.smithcreate