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

Method is_defined_in_a_branch

mypy/partially_defined.py:140–145  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

138 return name not in branch.may_be_defined and name not in branch.must_be_defined
139
140 def is_defined_in_a_branch(self, name: str) -> bool:
141 assert len(self.branches) > 0
142 for b in self.branches:
143 if name in b.must_be_defined or name in b.may_be_defined:
144 return True
145 return False
146
147 def done(self) -> BranchState:
148 # First, compute all vars, including skipped branches. We include skipped branches

Callers 1

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected