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

Method as_required_block

mypy/fastparse.py:606–616  ·  view source on GitHub ↗
(
        self, stmts: list[ast3.stmt], *, can_strip: bool = False, is_coroutine: bool = False
    )

Source from the content-addressed store, hash-verified

604 return b
605
606 def as_required_block(
607 self, stmts: list[ast3.stmt], *, can_strip: bool = False, is_coroutine: bool = False
608 ) -> Block:
609 assert stmts # must be non-empty
610 b = Block(
611 self.fix_function_overloads(
612 self.translate_stmt_list(stmts, can_strip=can_strip, is_coroutine=is_coroutine)
613 )
614 )
615 self.set_block_lines(b, stmts)
616 return b
617
618 def fix_function_overloads(self, stmts: list[Statement]) -> list[Statement]:
619 ret: list[Statement] = []

Callers 12

do_func_defMethod · 0.95
visit_ClassDefMethod · 0.95
visit_ForMethod · 0.95
visit_AsyncForMethod · 0.95
visit_WhileMethod · 0.95
visit_IfMethod · 0.95
visit_WithMethod · 0.95
visit_AsyncWithMethod · 0.95
visit_TryMethod · 0.95
visit_TryStarMethod · 0.95
visit_LambdaMethod · 0.95
visit_MatchMethod · 0.95

Calls 4

translate_stmt_listMethod · 0.95
set_block_linesMethod · 0.95
BlockClass · 0.90

Tested by

no test coverage detected