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