comments on runpy module

Alexey Luchko luch at
Fri Sep 23 14:38:36 EDT 2011

> Example """
> def f(arg):
>     return g(arg)
> def g(arg):
>     return arg
> """

> Reading the Lib/ I've found, that the temporary module created
> inside the run_path() calls, is destroyed right after the 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("") as a_namespace:


More information about the Python-list mailing list