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

Method as_block

mypy/fastparse.py:599–604  ·  view source on GitHub ↗
(self, stmts: list[ast3.stmt])

Source from the content-addressed store, hash-verified

597 b.column = new_first.column
598
599 def as_block(self, stmts: list[ast3.stmt]) -> Block | None:
600 b = None
601 if stmts:
602 b = Block(self.fix_function_overloads(self.translate_stmt_list(stmts)))
603 self.set_block_lines(b, stmts)
604 return b
605
606 def as_required_block(
607 self, stmts: list[ast3.stmt], *, can_strip: bool = False, is_coroutine: bool = False

Callers 6

visit_ForMethod · 0.95
visit_AsyncForMethod · 0.95
visit_WhileMethod · 0.95
visit_IfMethod · 0.95
visit_TryMethod · 0.95
visit_TryStarMethod · 0.95

Calls 4

translate_stmt_listMethod · 0.95
set_block_linesMethod · 0.95
BlockClass · 0.90

Tested by

no test coverage detected