MCPcopy
hub / github.com/python/mypy / Block

Class Block

mypy/nodes.py:1804–1820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802
1803
1804class Block(Statement):
1805 __slots__ = ("body", "is_unreachable")
1806
1807 __match_args__ = ("body", "is_unreachable")
1808
1809 def __init__(self, body: list[Statement], *, is_unreachable: bool = False) -> None:
1810 super().__init__()
1811 self.body = body
1812 # True if we can determine that this block is not executed during semantic
1813 # analysis. For example, this applies to blocks that are protected by
1814 # something like "if PY3:" when using Python 2. However, some code is
1815 # only considered unreachable during type checking and this is not true
1816 # in those cases.
1817 self.is_unreachable = is_unreachable
1818
1819 def accept(self, visitor: StatementVisitor[T]) -> T:
1820 return visitor.visit_block(self)
1821
1822
1823# Statements

Callers 15

make_fake_typeinfoMethod · 0.90
translate_stmt_listMethod · 0.90
as_blockMethod · 0.90
as_required_blockMethod · 0.90
visit_TypeAliasMethod · 0.90
missing_infoFunction · 0.90
basic_new_typeinfoMethod · 0.90
add_methodMethod · 0.90
visit_blockMethod · 0.90
read_statementFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…