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

Class LambdaExpr

mypy/nodes.py:2869–2890  ·  view source on GitHub ↗

Lambda expression

Source from the content-addressed store, hash-verified

2867
2868
2869class LambdaExpr(FuncItem, Expression):
2870 """Lambda expression"""
2871
2872 __match_args__ = ("arguments", "arg_names", "arg_kinds", "body")
2873
2874 @property
2875 def name(self) -> str:
2876 return LAMBDA_NAME
2877
2878 def expr(self) -> Expression:
2879 """Return the expression (the body) of the lambda."""
2880 ret = self.body.body[-1]
2881 assert isinstance(ret, ReturnStmt)
2882 expr = ret.expr
2883 assert expr is not None # lambda can't have empty body
2884 return expr
2885
2886 def accept(self, visitor: ExpressionVisitor[T]) -> T:
2887 return visitor.visit_lambda_expr(self)
2888
2889 def is_dynamic(self) -> bool:
2890 return False
2891
2892
2893class ListExpr(Expression):

Callers 5

visit_LambdaMethod · 0.90
visit_TypeAliasMethod · 0.90
visit_lambda_exprMethod · 0.90
read_type_alias_stmtFunction · 0.90
read_expressionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…