I have a threaded program in Python that works fine except that \_\_del\_\_ does not get called once the thread is running:

```
class tt(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
        self.stop_event = threading.Event()

    def __del__(self):
        print "Deleting"
        self.stop_event.set()
        time.sleep(5)

    def run(self):
        self.stop_event.clear()
        while not self.stop_event.isSet():
             self.do_stuff()
        threading.Thread.__init__(self)

    def stop(self):
        self.stop_event.set()

```

For example if I do

```
tc = aa()
del tc 

```

It works fine (I get the deleting message pause etc). However if I do:

```
tc = aa()
tc.start()
del tc

```

Then the \_\_del\_\_ does not get run (Note it does execute \_\_del\_\_ when I do tc.start(); tc.stop(); del tc. 

I'm running this in ipython