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

Method is_possibly_undefined

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

Source from the content-addressed store, hash-verified

274 return self._scope().pop_undefined_ref(name)
275
276 def is_possibly_undefined(self, name: str) -> bool:
277 assert len(self._scope().branch_stmts) > 0
278 # A variable is undefined if it's in a set of `may_be_defined` but not in `must_be_defined`.
279 return self._scope().branch_stmts[-1].is_possibly_undefined(name)
280
281 def is_defined_in_different_branch(self, name: str) -> bool:
282 """This will return true if a variable is defined in a branch that's not the current branch."""

Callers

nothing calls this directly

Calls 3

_scopeMethod · 0.95
lenFunction · 0.85
is_possibly_undefinedMethod · 0.45

Tested by

no test coverage detected