title: In Python, how do you change an instantiated object after a reload?
body: <p>Let's say you have an object that was instantiated from a class inside a module.
  Now, you reload that module.
  The next thing you'd like to do is make that reload affect that class.</p>
  
  <pre><code>mymodule.py
  ---
  class ClassChange():
      def run(self):
          print 'one'
  
  myexperiment.py
  ---
  import mymodule
  from mymodule import ClassChange  # why is this necessary?
  myObject = ClassChange()
  myObject.run()
  &gt;&gt;&gt; one
  ### later, i changed this file, so that it says print 'two'
  
  reload(mymodule)
  # trick to change myObject needed here
  myObject.run()
  &gt;&gt;&gt; two
  </code></pre>
  
  <p>Do you have to make a new ClassChange object, copy myObject into that, and delete the old myObject?  Or is there a simpler way?</p>
  
  <p>Edit: The run() method seems like a static class style method but that was only for the sake of brevity.  I'd like the run() method to operate on data inside the object, so a static module function wouldn't do...</p>