• Jeffrey Yasskin's avatar
    Prevent classes like: · 3414ea9e
    Jeffrey Yasskin yazdı
        class RunSelfFunction(object):
            def __init__(self):
                self.thread = threading.Thread(target=self._run)
                self.thread.start()
            def _run(self):
                pass
    from creating a permanent cycle between the object and the thread by having the
    Thread delete its references to the object when it completes.
    
    As an example of the effect of this bug, paramiko.Transport inherits from
    Thread to avoid it.
    3414ea9e
test_threading.py 10.6 KB