Python dummy_threading 模块,local() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用dummy_threading.local()

项目:modelchemy    作者:rjusher    | 项目源码 | 文件源码
def __init__(self, init=None):

        if init is None:
            init = {}

        def callback():
            return scoped_session(
                sessionmaker(class_=RoutedSession, registry=dbs)
            )

        self._session_factory = callback

        self.storage = threading.local()
        self.storage.lazies = {}
        self.storage.concrete = {}
        self.storage.metadatas = {}
        self.lazies.update(init)