title: Opposite of __init__ in thread class?
body: <p>I understand that <code>__init__()</code> is called automatically when you create a class like <code>newThread = MyThread(property)</code> and <code>run()</code> is triggered by <code>newthread.start()</code>. What I am looking for is something that is called automatically before a thread terminates, so I don't have to explicitly call <code>self.cleanUp()</code> before each return statement.</p>
  <pre><code>class MyThread(Thread): 
    
      def __init__(self, property): 
          Thread.__init__(self)
          self.property = property
  
      def cleanUp(self):
          # Clean up here
   
      def run(self):
          # Do some stuff
          self.cleanUp() # Current work around
          return
  </code></pre>