no more reload() in py3k

T

timaranz

Hi all, this is possibly a python-dev question but I'll ask here
first.

Situation:
I work on an application that takes 10-20 seconds to startup plus
opening a document. To avoid having to restart the entire application
each edit-debug cycle we rely heavily on the reload command. A typical
method in our command dispatcher looks like this:

def edit_something(self, something):
reload(meshDialogModule)
dlg = meshDialogModule.MeshDialog(self.app, something)
dlg.run()

when the application is built into an exe the reload function is
redefined to lambda x: x.
The advantage of this is that every time I open a dialog my latest
changes are applied and the debug cycle is: edit code -> open dialog -test -> close dialog -> edit code, which is many times faster than
restarting the app and opening a project each time.

Question:
I am told to use the exec() statement instead. I don't see how I can
use exec to reload a module.

Cheers
Tim
 
T

Terry Reedy

I believe Guido said on the Py3 dev list that reload should have been moved
to one of the modules (maybe inspect) rather than removed completely (and
that he missed it also). So this appears to be an alpha1 glitch.

tjr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top