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

Method record_nested_branch

mypy/partially_defined.py:117–125  ·  view source on GitHub ↗
(self, state: BranchState)

Source from the content-addressed store, hash-verified

115 self.branches[-1].may_be_defined.discard(name)
116
117 def record_nested_branch(self, state: BranchState) -> None:
118 assert len(self.branches) > 0
119 current_branch = self.branches[-1]
120 if state.skipped:
121 current_branch.skipped = True
122 return
123 current_branch.must_be_defined.update(state.must_be_defined)
124 current_branch.may_be_defined.update(state.may_be_defined)
125 current_branch.may_be_defined.difference_update(current_branch.must_be_defined)
126
127 def skip_branch(self) -> None:
128 assert len(self.branches) > 0

Callers 1

end_branch_statementMethod · 0.80

Calls 2

lenFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected