MCPcopy Index your code
hub / github.com/python/mypy / visit_Lambda

Method visit_Lambda

mypy/fastparse.py:1526–1535  ·  view source on GitHub ↗
(self, n: ast3.Lambda)

Source from the content-addressed store, hash-verified

1524
1525 # Lambda(arguments args, expr body)
1526 def visit_Lambda(self, n: ast3.Lambda) -> LambdaExpr:
1527 body = ast3.Return(n.body)
1528 body.lineno = n.body.lineno
1529 body.col_offset = n.body.col_offset
1530
1531 self.class_and_function_stack.append("L")
1532 e = LambdaExpr(self.transform_args(n.args, n.lineno), self.as_required_block([body]))
1533 self.class_and_function_stack.pop()
1534 e.set_line(n.lineno, n.col_offset) # Overrides set_line -- can't use self.set_line
1535 return e
1536
1537 # IfExp(expr test, expr body, expr orelse)
1538 def visit_IfExp(self, n: ast3.IfExp) -> ConditionalExpr:

Callers

nothing calls this directly

Calls 6

transform_argsMethod · 0.95
as_required_blockMethod · 0.95
LambdaExprClass · 0.90
appendMethod · 0.80
popMethod · 0.45
set_lineMethod · 0.45

Tested by

no test coverage detected