def visit_Lambda(self, n: ast27.Lambda) -> FuncExpr: body = ast27.Return(n.body) body.lineno = n.lineno body.col_offset = n.col_offset return FuncExpr(self.transform_args(n.args, n.lineno), self.as_block([body], n.lineno))
def visit_Lambda(self, n: ast27.Lambda) -> LambdaExpr: args, decompose_stmts = self.transform_args(n.args, n.lineno) n_body = ast27.Return(n.body) n_body.lineno = n.lineno n_body.col_offset = n.col_offset body = self.as_required_block([n_body], n.lineno) if decompose_stmts: body.body = decompose_stmts + body.body return LambdaExpr(args, body)
def visit_Lambda(self, n: ast27.Lambda) -> LambdaExpr: args, decompose_stmts = self.transform_args(n.args, n.lineno) n_body = ast27.Return(n.body) n_body.lineno = n.lineno n_body.col_offset = n.col_offset body = self.as_required_block([n_body], n.lineno) if decompose_stmts: body.body = decompose_stmts + body.body e = LambdaExpr(args, body) e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line return e