Message82005
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). |
|
Date |
User |
Action |
Args |
2009-02-14 10:31:09 | eric.smith | set | recipients:
+ eric.smith, terry.reedy, mark.dickinson, pitrou, LambertDW, ezio.melotti |
2009-02-14 10:31:08 | eric.smith | set | messageid: <1234607468.23.0.535527595034.issue5237@psf.upfronthosting.co.za> |
2009-02-14 10:31:06 | eric.smith | link | issue5237 messages |
2009-02-14 10:30:54 | eric.smith | create | |
|