MCPcopy Create free account
hub / github.com/python/mypy / optional_expr

Method optional_expr

mypy/treetransform.py:748–752  ·  view source on GitHub ↗
(self, expr: Expression | None)

Source from the content-addressed store, hash-verified

746 # All the node helpers also propagate line numbers.
747
748 def optional_expr(self, expr: Expression | None) -> Expression | None:
749 if expr:
750 return self.expr(expr)
751 else:
752 return None
753
754 def block(self, block: Block) -> Block:
755 new = self.visit_block(block)

Callers 10

visit_class_defMethod · 0.95
visit_return_stmtMethod · 0.95
visit_assert_stmtMethod · 0.95
visit_raise_stmtMethod · 0.95
visit_yield_exprMethod · 0.95
visit_call_exprMethod · 0.95
visit_op_exprMethod · 0.95
visit_slice_exprMethod · 0.95
optional_expressionsMethod · 0.95

Calls 1

exprMethod · 0.95

Tested by

no test coverage detected