converter.py 文件源码

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

项目:py2cpp 作者: mugwort-rc 项目源码 文件源码
def visit_FunctionDef(self, node):
        name = node.name
        args = self.visit(node.args)
        body = [self.visit(x) for x in node.body]
        docstring = ast.get_docstring(node)
        if docstring:
            body = body[1:]
        if hasattr(node, "returns"):
            returns = self.visit(node.returns)
        else:
            returns = None
        # TODO: decorator_list
        return cpp.FunctionDef(name=name, args=args, body=body, docstring=docstring, returns=returns)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号