utils.py 文件源码

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

项目:MDT 作者: cbclab 项目源码 文件源码
def _get_node_line_end(self, node):
        """Get the last line of the given node.

        This function can recurse if the given node is a complex node (like a FunctionDef node).

        Args:
            node (ast.Node): a node of the AST

        Returns:
            int: the last line of the statements in the given node
        """
        if isinstance(node, ast.Assign):
            return node.value.lineno
        elif isinstance(node, ast.FunctionDef):
            return self._get_node_line_end(node.body[-1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号