ututil.py 文件源码

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

项目:pykit 作者: baishancloud 项目源码 文件源码
def _find_frame_by_self(clz):
    """
    Find the first frame on stack in which there is local variable 'self' of
    type clz.
    """

    frame = inspect.currentframe()

    while frame:
        self = frame.f_locals.get('self')
        if isinstance(self, clz):
            return frame

        frame = frame.f_back

    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号