tzickel <icebr...@yahoo.com> added the comment:
It actually makes tons of sense that while the thread is running, that the object representing it is alive. After the thread finishes its work, the object dies. >>> import time, threading, weakref, gc >>> t = threading.Thread(target=time.sleep, args=(10,)) >>> wr = weakref.ref(t) >>> t.start() >>> del t >>> gc.collect() >>> wr() <Thread(Thread-1, started 139937234327296)> Wait 10 seconds... >>> gc.collect() >>> wr() The thread is gone (which doesn't happen with the pool). Anyhow, I've submitted a patch to fix the bug that was introduced 9 years ago on GH, feel free to check it. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34172> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com