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

Method mark_unreachable

mypy/checker.py:584–587  ·  view source on GitHub ↗

Marks all statements in block after a given one (inclusive) as unreachable.

(self, block: list[Statement], after: Statement)

Source from the content-addressed store, hash-verified

582 self.globals_unreachable.clear()
583
584 def mark_unreachable(self, block: list[Statement], after: Statement) -> None:
585 """Marks all statements in block after a given one (inclusive) as unreachable."""
586 last_line = (last := block[-1]).end_line or last.line
587 self.globals_unreachable.update(range(after.line, last_line + 1))
588
589 def check_first_pass(self, recurse_into_functions: bool = True) -> None:
590 """Type check the entire file, but defer functions with unresolved references.

Callers 2

check_first_passMethod · 0.95
visit_blockMethod · 0.95

Calls 2

rangeClass · 0.85
updateMethod · 0.45

Tested by

no test coverage detected