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

Method visit_if_stmt

mypy/partially_defined.py:393–409  ·  view source on GitHub ↗
(self, o: IfStmt)

Source from the content-addressed store, hash-verified

391 self.process_lvalue(o.target)
392
393 def visit_if_stmt(self, o: IfStmt) -> None:
394 for e in o.expr:
395 e.accept(self)
396 self.tracker.start_branch_statement()
397 for b in o.body:
398 if b.is_unreachable:
399 continue
400 b.accept(self)
401 self.tracker.next_branch()
402 if o.unreachable_else:
403 self.tracker.skip_branch()
404 elif o.else_body:
405 if o.else_body.is_unreachable:
406 self.tracker.skip_branch()
407 else:
408 o.else_body.accept(self)
409 self.tracker.end_branch_statement()
410
411 def visit_match_stmt(self, o: MatchStmt) -> None:
412 o.subject.accept(self)

Callers

nothing calls this directly

Calls 5

end_branch_statementMethod · 0.80
acceptMethod · 0.45
next_branchMethod · 0.45
skip_branchMethod · 0.45

Tested by

no test coverage detected