'reload M' doesn't update 'from M inport *'

Jean-Michel Pichavant jeanmichel at sequans.com
Mon Jul 12 05:47:00 EDT 2010


>> Hi,
>>
>> Don't use reload, this is nothing but a trap, espacially if your using 
>> it to update your objects with the code you are writting.
>>
>> JM
>>     
>
> I've found "reload" very usable for development in IDLE. IDLE memorizes
> my input, and the variables I assign output to. If restart IDLE I lose
> it all and start over. That is an awfully awkward alternative to
> "reload", an alternative I wouldn't consider.
>    I found "reload" tricky with several modules, because all
> dependencies need to be updated and which way they go isn't always
> obvious. Reloading all modules in the right order works for me. The
> reload commands come up with Alt-P as long, precisely, as I don't
> restart IDLE. 
>   

Instead of writing your test code in the IDLE shell, write it into a 
file, an run this file in IDLE (from the IDLE file edit window hit F5). 
That way restarting from the begining is costless.

If you insist on using reload, then you've already been given helpful 
answers, understanding the import model is always a good thing anyway :)

JM







More information about the Python-list mailing list