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

Method visit_With

mypy/fastparse.py:1339–1347  ·  view source on GitHub ↗
(self, n: ast3.With)

Source from the content-addressed store, hash-verified

1337
1338 # With(withitem* items, stmt* body, string? type_comment)
1339 def visit_With(self, n: ast3.With) -> WithStmt:
1340 target_type = self.translate_type_comment(n, n.type_comment)
1341 node = WithStmt(
1342 [self.visit(i.context_expr) for i in n.items],
1343 [self.visit(i.optional_vars) for i in n.items],
1344 self.as_required_block(n.body),
1345 target_type,
1346 )
1347 return self.set_line(node, n)
1348
1349 # AsyncWith(withitem* items, stmt* body, string? type_comment)
1350 def visit_AsyncWith(self, n: ast3.AsyncWith) -> WithStmt:

Callers

nothing calls this directly

Calls 5

visitMethod · 0.95
as_required_blockMethod · 0.95
set_lineMethod · 0.95
WithStmtClass · 0.90

Tested by

no test coverage detected