completely implicit interpolation based on a frame object

Edward Peschko horos11 at gmail.com
Thu Dec 9 02:29:52 EST 2010


>> Any ideas would be great on this, including pitfalls that people see
>> in implementing it.
>>
> http://docs.python.org/library/string.html#template-strings
>
> regards
>  Steve

Steve,

Thanks for the tip, I did look at templates and decided that they
weren't quite completely what I was looking for, although they could
be part of the solution.

1. they require ${ } around the variables in question that you want to
interpolate. When run through the trace hook, normal code doesn't do
that.
2. they don't provide (AFAICT) a complete interpolation solution.
Suppose I want to define custom interpolations in my tracer, like say,
expanding out lists and dicts, or fleshing out objects using their
stringification method. Does template do this?

Formats may be a bit closer here, but I'm not sure if they are
workable (or usable) with 2.5... which is where I need to work.

Ed



More information about the Python-list mailing list