where is upvar

Harald Kirsch kirschh at lionbioscience.com
Wed Sep 20 07:38:21 EDT 2000


In Tcl there exists the possibility to create in a function an alias
for a variable in the calling stack frame. The mechanism is

  upvar parentsVar myNameForParentsVariable

Every reference to myNameForParentsVariable in fact reads or writes the
variable in the calling stack frame.

Is there such a mechanism in python besides doing things like

  eval(theScriptReturnedByThisFunctionCall())

in the calling function?

And then, how can I check if a certain variable exists in a given
stack frame?

  Harald Kirsch
-- 
----------------+------------------------------------------------------
Harald Kirsch   | kirschh at lionbioscience.com | We make the tools to
LION Bioscience | +49 6221 4038 172          | reverse engineer nature.



More information about the Python-list mailing list