class MyThread(threading.Thread):

    def __init__(self, widget):
        self.widget = widget
self.is_running = False
super(MyThread, self).__init__()

def run(self):
    self.is_running = True
while self.is_running:
    time.sleep(1)
In python, is there a way to make threads that die when there is no longer a reference to them?