[Python-Dev] Can we please have a better dict interpolation syntax?

Barry Warsaw barry at python.org
Thu Oct 23 11:02:16 EDT 2003


On Thu, 2003-10-23 at 09:55, Skip Montanaro wrote:

> What if lid1 is a float which you want to display with two digits past the
> decimal point?

BTW, I should mention that IMO, $-strings are great for end-user
editable string templates, such as (in Mailman) things like translatable
strings or message footer templates.  

But I also think the existing %-strings are just fine for programmers. 
I would definitely be opposed to complicating $-strings with any of the
specialized and fine-grained control you have with %-strings.  KISS and
you'll have a great 99% solution, as long as you accept that the two
substitution formats are aimed at different audiences.

Then again, see my last post.  I'm not sure anything needs to be added
to core Python to support useful $-strings.  Or maybe it can be
implemented as a library module (or part of a 'textutils' package).

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20031023/b1b7b4bf/attachment.bin


More information about the Python-Dev mailing list