events.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:pyetje 作者: rorlika 项目源码 文件源码
def _listen(cls, target, identifier, fn, propagate=True):

        def listen(target_cls, *arg):
            listen_cls = target()
            if propagate and issubclass(target_cls, listen_cls):
                return fn(target_cls, *arg)
            elif not propagate and target_cls is listen_cls:
                return fn(target_cls, *arg)

        def remove(ref):
            event.Events._remove(orm.instrumentation._instrumentation_factory,
                                            identifier, listen)

        target = weakref.ref(target.class_, remove)
        event.Events._listen(orm.instrumentation._instrumentation_factory,
                        identifier, listen)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号