Draft PEP: string interpolation with backquotes

John Roth johnroth at ameritech.net
Mon Dec 3 20:40:12 CET 2001


"Fernando Pérez" <fperez528 at yahoo.com> wrote in message
news:9ueh23$9e8$1 at peabody.colorado.edu...
> John Roth wrote:
>
> >
> > "Oren Tirosh" <oren-py-l at hishome.net> wrote in message
> > news:mailman.1007298422.20078.python-list at python.org...
> >
> > I don't see what I could do with this that I couldn't do with the
> > '%' operator.
> > Someone help me out on this?
> >
> > John Roth
>
> Here's a copy of an older post of mine. It concerned another pep
> implementing the same idea with $ instead of ``. But the discussion
> is the same:
>
>
> --------------# begin paste
>
> 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. Currently we
> have a few options. Please keep in mind that this is really important
> only when the string and evaluations to handle grows dramatically in
> size and complexity. Think of 50 line strings with 100 complex
> expression evaluations embedded (and yes, things like that can happen
> fairly easily):

I do tend to do things like that frequently when I'm doing a debug
print statement. Otherwise, it's not something I write a lot.

John Roth





More information about the Python-list mailing list