debug.py 文件源码

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

项目:python-devtools 作者: samuelcolvin 项目源码 文件源码
def _get_offsets(func_ast):
        for arg in func_ast.args:
            start_line, start_col = arg.lineno - 2, arg.col_offset - 1

            # horrible hack for http://bugs.python.org/issue31241
            if isinstance(arg, (ast.ListComp, ast.GeneratorExp)):
                start_col -= 1
            yield start_line, start_col
        for kw in func_ast.keywords:
            yield kw.value.lineno - 2, kw.value.col_offset - len(kw.arg) - 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号