Closed
Description
Feature or enhancement
Proposal:
This has bothered me quite a bit already: If some code calls threading.current_thread() in a thread that’s not created from the threading module it lingers at threading._active forever (or until another thread with the same thread.ident is created, which isn’t that uncommon).
My suggestion would be to remove it when the thread dies.
I'll provide a PR.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/remove-dummythread-from-threading-active-when-thread-dies/41322