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
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
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.