Feb. 25, 2002
8:44 p.m.
paul wrote:
Your strategy requires the naive user to learn a) the $ syntax, b) the magic operator syntax and c) the meaning of the locals() function. Plus you've thrown away the idea that interpolation works as it does in the shell or in Perl/Awk/Ruby etc.
At that point, in my mind, we're back where we started and should just use %.
# interpolate! s = I('Joe has $ ', a, ' in his pocket.') or perhaps # print-like interpolation s = P('Joe has $', a, 'in his pocket.') works pretty well too. in all versions of python, with all existing syntax-aware tools. and if written in C, it's probably as fast as any other solution... (implementing I/P is left as an exercise etc etc) </F>