How to pass a reference to the current module

James Stroud jstroud at mbi.ucla.edu
Fri Aug 3 21:32:54 EDT 2007


Carsten Haese wrote:
> This seems to confirm my suspicion that the do_something_with function
> doesn't actually need a reference to the module, it only needs a
> reference to the function to call.
> 
> Maybe your hurdle is how to obtain a reference to a function from the
> current module when all you have is the name of the function in a
> string. The answer to that would be "globals()[funcname]".

This is like a bad case of phone-tag. Please see my response to your 
previous post for why this does not seem feasible to me.

James


-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list