py_ast.py 文件源码

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

项目:neoreader 作者: MaxwellBo 项目源码 文件源码
def visit_FunctionDef(self, node, is_async=False):
        docstring = f"\"{get_docstring(node, True)}\""
        body = node.body
        if docstring:
            body = body[1:]  # Don't mention it

        summary = ""\
            + f"{interpret_async(is_async)} function called \"{node.name}\""\
            + f", taking {self.visit(node.args)}"\
            + (f", and returning a value of {self.visit(node.returns)}" if node.returns else "")\
            + (f", with the docstring of {docstring}" if docstring else "")\
            + f", with a body of {self.visit(body)}"

        return summary
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号