Example script.py: """
def f(arg):
    return g(arg)

def g(arg):
    return arg
"""

Reading the Lib/runpy.py I've found, that the temporary module created
inside the run_path() calls, is destroyed right after the script.py code
executed in the resulting namespace.

I've got an idea.  It would be nice if there existed such a way to use it:
with runpy.run_path("script.py") as a_namespace:
  a_namespace["f"]("abc")

--
Regards,
Alex.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to