예제 #1
0
    def visit_Call(self, node: ast.Call) -> ast.Call:
        if not self._has_starred(node.args):
            return self.generic_visit(self.generic_visit(node))  # type: ignore

        args = self._to_sum_of_lists(node.args)
        node.args = [ast.Starred(value=args)]
        return self.generic_visit(node)  # type: ignore
    def visit_Call(self, n):
        args = self.visit(n.args)
        if n.starargs is not None:
            args.append(ast3.Starred(self.visit(n.starargs), ast3.Load(), lineno=n.starargs.lineno, col_offset=n.starargs.col_offset))

        keywords = self.visit(n.keywords)
        if n.kwargs is not None:
            keywords.append(ast3.keyword(None, self.visit(n.kwargs)))

        return ast3.Call(self.visit(n.func),
                         args,
                         keywords)