[IPython-user] Module reload in interactive mode
Tue Feb 10 19:35:28 CST 2009
On Tue, Feb 10, 2009 at 1:54 PM, Robin <firstname.lastname@example.org> wrote:
> On Tue, Feb 10, 2009 at 9:43 PM, Ignazio Di Napoli <email@example.com> wrote:
> I think the problem is the use of "from package import *" - I don't
> think you'll ever get reloading to work properly - especially if using
> that inside __init__.py (I may be wrong though).
You are completely correct in 'import *' being the source of the
problem, and it being discouraged. Having said that, there is a way
to make it work, and that is to put in your script:
from foo import *
# rest of script...
In that case, if you edit foo.py and rerun the script, it will pick up
the changes correctly.
More information about the IPython-user