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])
评论列表
文章目录