without stopping pythonchange all three filesassignment values and save from imp import reload reload(aa xa ya ( from reloadall import reload_all reload_all(areloading reloading reloading xa ya ( built-in reload is top level only normal usage mode reloads all nested modules too study the reloader' code and results for more on its operation the next section exercises its tools further alternative codings for all the recursion fans in the audiencethe following lists an alternative recursive coding for the function in the prior section--it uses set instead of dictionary to detect cyclesis marginally more direct because it eliminates top-level loopand serves to illustrate recursive function techniques in general (compare with the original to see how this differsthis version also gets some of its work for free from the originalthough the order in which it reloads modules might vary if namespace dictionary order does too""reloadall pytransitively reload nested modules (alternative coding""import types from imp import reload from reloadall import statustryreloadtester from required in def transitive_reload(objectsvisited)for obj in objectsif type(obj=types moduletype and obj not in visitedstatus(objtryreload(objreload thisrecur to attrs visited add(objtransitive_reload(obj __dict__ values()visiteddef reload_all(*args)transitive_reload(argsset()if __name__ ='__main__'tester(reload_all'reloadall 'test codereload myselfexampletransitive module reloads