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

Method record_undefined_ref

mypy/partially_defined.py:266–269  ·  view source on GitHub ↗

Records an undefined reference. These can later be retrieved via `pop_undefined_ref`.

(self, o: NameExpr)

Source from the content-addressed store, hash-verified

264 self._scope().branch_stmts[-1].delete_var(name)
265
266 def record_undefined_ref(self, o: NameExpr) -> None:
267 """Records an undefined reference. These can later be retrieved via `pop_undefined_ref`."""
268 assert len(self.scopes) > 0
269 self._scope().record_undefined_ref(o)
270
271 def pop_undefined_ref(self, name: str) -> set[NameExpr]:
272 """If name has previously been reported as undefined, the NameExpr that was called will be returned."""

Callers

nothing calls this directly

Calls 3

_scopeMethod · 0.95
lenFunction · 0.85
record_undefined_refMethod · 0.45

Tested by

no test coverage detected