class classB(object):
def Bfunc1(self):
"from here how can I access the 'self' of the calling class?"
class classA(object):
def __init__(self):
self._threadLocal = threading.local()
def func1(self):
self._threadLocal.x = 'stuff'
cb = classB()
cb.Bfunc1() <---
我正在尝试查看是否可以从classA到classB实例检索存储在threadlocal中的某些数据。我的问题是“self”引用被绑定到实例化的类。这可能吗
目前没有回答
相关问题 更多 >
编程相关推荐