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

Class MarkImportsUnreachableVisitor

mypy/reachability.py:340–350  ·  view source on GitHub ↗

Visitor that flags all imports nested within a node as unreachable.

Source from the content-addressed store, hash-verified

338
339
340class MarkImportsUnreachableVisitor(TraverserVisitor):
341 """Visitor that flags all imports nested within a node as unreachable."""
342
343 def visit_import(self, node: Import) -> None:
344 node.is_unreachable = True
345
346 def visit_import_from(self, node: ImportFrom) -> None:
347 node.is_unreachable = True
348
349 def visit_import_all(self, node: ImportAll) -> None:
350 node.is_unreachable = True
351
352
353def mark_block_mypy_only(block: Block) -> None:

Callers 1

mark_block_unreachableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…