views:

34

answers:

2

when using idle, I know you can reload a module if it's changed like this:

import foo
reload(foo)

if I only import part of a module, is there a way to reload it in a similar matter?

from foo import bar
+1  A: 

No. You'll have to import foo, then reload(foo), after all.

djc
+1  A: 

No, reload has to re-run the whole module.

Note that reload is confusing and does not have the ability to be consistent. It's much better to restart the interpreter.

Mike Graham