title: "AssertionError: Thread.__init__() not called" when initializing a subclass of threading.Thread
body: <p>I would like to make a program which runs two threads which can be simultaneously interrupted using <kbd>ctrl</kbd>+<kbd>C</kbd>. The following script is a simplified version of this:</p>
  
  <pre><code>import time
  import threading
  
  class Controller(object):
      def __init__(self, name=None):
          self.name = name
  
      def run_once(self):
          print("Controller {} is running once...".format(self.name))
  
      def run_forever(self):
          while True:
              self.run_once()
              time.sleep(1)
  
  if __name__ == "__main__":
      controller1 = Controller(name="1")
      controller2 = Controller(name="2")
      thread1 = threading.Thread(target=controller1.run_forever)
      thread2 = threading.Thread(target=controller2.run_forever)
      thread1.daemon = True
      thread2.daemon = True
      thread1.start()
      thread2.start()
  
  
      try:
          while True:
              thread1.join(1)
              thread2.join(1)
              if not thread1.isAlive() or not thread2.isAlive():
                  break
      except KeyboardInterrupt:
          pass
  </code></pre>
  
  <p>I'm trying to make the code a bit more DRY by doing the following:</p>
  
  <pre><code>import time
  import threading
  
  class Controller(object):
      def __init__(self, name=None):
          self.name = name
  
      def run_once(self):
          print("Controller {} is running once...".format(self.name))
  
      def run_forever(self):
          while True:
              self.run_once()
              time.sleep(1)
  
  class ThreadController(Controller, threading.Thread):
      def __init__(self, *args, **kwargs):
          Controller.__init__(self, *args, **kwargs)
          threading.Thread.__init__(self, target=self.run_forever)
          self.daemon = True
          self.start()
  
  
  if __name__ == "__main__":
      thread1 = ThreadController(name="1")
      thread2 = ThreadController(name="2")
  
      try:
          while True:
              thread1.join(1)
              thread2.join(1)
              if not thread1.isAlive() or not thread2.isAlive():
                  break
      except KeyboardInterrupt:
          pass
  </code></pre>
  
  <p>However, when I try to run the latter script, I get the following error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "threading_test3.py", line 34, in &lt;module&gt;
      thread1 = ThreadController(name="1")
    File "threading_test3.py", line 18, in __init__
      Controller.__init__(self, *args, **kwargs)
    File "threading_test3.py", line 6, in __init__
      self.name = name
    File "/usr/lib/python2.7/threading.py", line 971, in name
      assert self.__initialized, "Thread.__init__() not called"
  AssertionError: Thread.__init__() not called
  </code></pre>
  
  <p>I don't understand why <code>Thread.__init__()</code> is not called, because it seems like it is called in the <code>__init__</code> of <code>ThreadController</code>. What is causing this error?</p>