April 21, 2015
2 p.m.
eryksun added the comment: Could you clarify what the problem is? I have no apparent problem using threading.local in a function scope: import threading def f(): tlocal = threading.local() tlocal.x = 0 def g(): tlocal.x = 1 print('tlocal.x in g:', tlocal.x) t = threading.Thread(target=g) t.start() t.join() print('tlocal.x in f:', tlocal.x) >>> f() tlocal.x in g: 1 tlocal.x in f: 0 ---------- nosy: +eryksun _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24020> _______________________________________