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

Method __init__

mypy/partially_defined.py:203–209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 """DefinedVariableTracker manages the state and scope for the UndefinedVariablesVisitor."""
202
203 def __init__(self) -> None:
204 # There's always at least one scope. Within each scope, there's at least one "global" BranchingStatement.
205 self.scopes: list[Scope] = [Scope([BranchStatement()], ScopeType.Global)]
206 # disable_branch_skip is used to disable skipping a branch due to a return/raise/etc. This is useful
207 # in things like try/except/finally statements.
208 self.disable_branch_skip = False
209 self.in_finally = False
210
211 def copy(self) -> DefinedVariableTracker:
212 result = DefinedVariableTracker()

Callers

nothing calls this directly

Calls 2

BranchStatementClass · 0.85
ScopeClass · 0.70

Tested by

no test coverage detected