[IPython-user] Module reload in interactive mode

Robin robince@gmail....
Tue Feb 10 15:54:38 CST 2009


On Tue, Feb 10, 2009 at 9:43 PM, Ignazio Di Napoli <neclepsio@gmail.com> wrote:
>> Perhaps you could check your ipython version and give a minimal
>> example like the above of what doesn't work.
> Version is last stable (0.9.1) under Windows.
> The code to show it is:
> *** prova/test.py:
> from package import *
> function()

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

Generally I think the use of from... import * is discouraged - this is
one example of why.

If you use namespaces explicitly you will probably have more luck. Eg:
in test.py:
import package.module as pm

then I would think reloading pm would pick up any changed.
theres probably a more readable way to get it to work.



More information about the IPython-user mailing list