| 1802 | |
| 1803 | |
| 1804 | class 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…