I would like to be able to dynamically retrieve the current executing module or class name from within an imported module. Here is some code:
foo.py:
This should work for referencing the current module:
import sys sys.modules[__name__]