load changes of subclasses

Jp Calderone exarkun at intarweb.us
Tue Sep 23 23:05:55 CEST 2003

On Tue, Sep 23, 2003 at 04:47:19PM +0200, Tom wrote:
> Hi,
> I have a main program  that uses a lot of definitions in different classes.
> They are included like this:
> from subclass1 import *
> from subclass2 import *
> My problem is: whenever I make changes in one of the classes I have to 
> close and reopen the main program for the changes to take effect. This 
> is kind of annoying, because I always want to test if my changes are 
> correct and that's why I have to run the main program. Is there some 
> kind of a shortcut where I don't have to close and reopen the main program?

  Others have suggested how you might get changes on disk reflected in your
running app, so I'll skip that.

  Wanting to test if your changes are correct is a very good thing, and
doing that by running a program that uses those changes is also a pretty
handy idea.  But maybe running your *main* program isn't the best way to go
about it.  Many developers use an approach called "unit testing" to verify
that each component of their application works as it should.  This makes
testing easier because it removes the interactive component, because it
provides a fine grained indicator of which part of your application is
broken, and because unit tests can be run quickly and frequently, which is
especially handy when you're only changing a small part of a large

  You can read more about unit testing on the Python website:



"The problem is, of course, that not only is economics bankrupt but it has
 always been nothing more than politics in disguise ... economics is a form
 of brain damage."  -- Hazel Henderson

More information about the Python-list mailing list