[Python-ideas] Draft PEP on string interpolation

Barry Warsaw barry at python.org
Tue Aug 25 02:20:08 CEST 2015


On Aug 24, 2015, at 11:55 AM, Eric V. Smith wrote:

>I should have added: this is for i-strings that look like PEP 498's
>f-strings. I'm not trying to jump to conclusions about the syntax:

I remember something else about $-strings, based on Mailman's experience.
Originally we also used %(foo)s strings, but when that reached the breaking
point (and PEP 292 was implemented), we changed to $-strings.  At that point
we had to provide an upgrade path for settings with the original %-strings.

It turns out to not be too difficult to translate between them.  It would
probably not be difficult to translate from $foo to {foo} either, so with a
properly defined hook, the porcelain could use $-strings while all the
underlying machinery could still use {}-strings.  It would probably have to be
roughly limited to simple name lookups with dot-chasing, and maybe it's not
worth it.

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150824/e43f61eb/attachment.sig>


More information about the Python-ideas mailing list