[Python-Dev] Free threading (and tcl upvar)

Barry A. Warsaw barry@zope.com
Thu, 9 Aug 2001 21:47:28 -0400


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    GvR> That's why we have sys._getframe(). ;-)

btw, when you need it, sys._getframe() is a godsend.  thank the genius
who came up with that one <wink>.

i've been using it in mailman in my _() wrapper (for marking
translatable strings), and because you have to use %()s named
interpolation instead of %s positional interpolation, using
_getframe() to "get at" the locals one frame up makes the call site
very clean and compact, with (imo) no loss of clarity or feeling of
"too much magic".

i'm planning on writing a paper for ipcx on this stuff.

-barry