Draft PEP: string interpolation with backquotes

phil hunt philh at comuno.freeserve.co.uk
Sun Dec 2 21:08:10 EST 2001


On Sun, 02 Dec 2001 17:28:41 +2328, Fernando Pérez <fperez528 at yahoo.com> wrote:
>Exactly my point. I think when I mentioned my need of inserting % in 
>strange dynamic strings I inadvertedly set the discussion off-course. 
>That was just a side comment, and by no means the meat of my point. 
>My important point is that Ping's PEP allows a clear way of saying 
>
>        "x is $x, f(x) is $f(x)"
>
>This to me is readable, unambiguous and very useful.

To me it implies the same as:

   "x is %(x)s, f(x) is %(f)s(x)" % { 'x': x, 'f': f}

which of course isn't what you meant.

What's wrong with the existing way of doing things with "%"?


-- 
*** Philip Hunt *** philh at comuno.freeserve.co.uk ***




More information about the Python-list mailing list