[Python-Dev] extended print statement, uPre-PEP
Ka-Ping Yee
ping@lfw.org
Mon, 24 Jul 2000 02:13:42 -0700 (PDT)
On Sun, 23 Jul 2000, Paul Prescod wrote:
> As happy as I am to have it called Prescod-ese, I admit to influence
> from some languages that (otherwise) suck. :)
I agree that formatting and interpolation is one area where Perl is
much stronger, and it should be easy to do such things in Python.
> credit-where-due 'ly yrs
I kind of hate to do this, but i can't restrain myself from pointing
out that i *did* propose just this solution quite recently, in:
http://www.python.org/pipermail/python-dev/2000-July/012764.html
I wrote a module to do this a few years ago (1996, i think). It
supported attribute lookup, item lookup, and expressions. (No one
has yet mentioned the issue of escaping the dollar sign, which i
handled by doubling it.)
See the exact rules described, with examples, at
http://www.lfw.org/python/Itpl.html
If you want to play, just download
http://www.lfw.org/python/Itpl15.py
and try the itpl() function in the module.
I would be quite pleased if (for example) $"" performed the
equivalent of a function call to itpl() on the enclosed string.
Apologetically (& only *gently* indignant),
-- ?!ng