April 21, 2015
5:34 p.m.
Eric Snow added the comment: Think of threading.local this way: instances of threading.local are shared between all the threads, but the effective "__dict__" of each instance is per-thread. Basically, the object stores a dict for each thread. In __getattribute__, __setattr__, and __delattr__ it swaps the dict for the current thread into place and then does proceeds normally. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24020> _______________________________________