Message241714
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 |
|
Date |
User |
Action |
Args |
2015-04-21 14:00:21 | eryksun | set | recipients:
+ eryksun, docs@python, ethan.furman |
2015-04-21 14:00:21 | eryksun | set | messageid: <1429624821.5.0.944414118077.issue24020@psf.upfronthosting.co.za> |
2015-04-21 14:00:21 | eryksun | link | issue24020 messages |
2015-04-21 14:00:21 | eryksun | create | |
|