test_dis.py 文件源码

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

项目:web_ctp 作者: molebot 项目源码 文件源码
def get_disassembly(self, func, lasti=-1, wrapper=True):
        s = io.StringIO()
        save_stdout = sys.stdout
        sys.stdout = s
        try:
            if wrapper:
                dis.dis(func)
            else:
                dis.disassemble(func, lasti)
        finally:
            sys.stdout = save_stdout
        # Trim trailing blanks (if any).
        return [line.rstrip() for line in s.getvalue().splitlines()]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号