[Python-Dev] extended print statement, uPre-PEP

Barry A. Warsaw bwarsaw@beopen.com
Mon, 24 Jul 2000 11:30:47 -0400 (EDT)


>>>>> "PP" == Paul Prescod <paul@prescod.net> writes:

    PP>  1. "Why do I have to say the s in %()s when I'm using the s
    PP> formatting code 97.68% of the time?" I shouldn't need to. To
    PP> me, the s looks like a pluralization of listname and sender. A
    PP> template should have clear delimiters so that it is
    PP> straightforward to read.

    PP>  2. "Why do I have to tell it what namespace to evaluate in
    PP> when 93.5% of the time, it's vars()?"

>>>>> "KY" == Ka-Ping Yee <ping@lfw.org> writes:

    KY> I kind of hate to do this, but i can't restrain myself from
    KY> pointing out that i *did* propose just this solution quite
    KY> recently, in:

    KY> http://www.python.org/pipermail/python-dev/2000-July/012764.html

    KY> I wrote a module to do this a few years ago (1996, i think).
    KY> It supported attribute lookup, item lookup, and expressions.
    KY> (No one has yet mentioned the issue of escaping the dollar
    KY> sign, which i handled by doubling it.)

I think I've been lulled into conflating two different issues.  As I
see it doing the interpolation is separate from where the output goes,
however it's clear that ?!ng's printpl() function could grow the
optional keyword arguments that Moshe suggested.

Still, I think it makes sense for them to be two separate proposals
(with cross references if necessary).  I've decided to PEP the
extended print syntax and would be more than happy to assign a PEP
number for a string interpolation proposal, if someone else volunteers
to champion it.

-Barry