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

Method visit_symbol_table

mypy/fixup.py:116–133  ·  view source on GitHub ↗
(self, symtab: SymbolTable)

Source from the content-addressed store, hash-verified

114
115 # NOTE: This method *definitely* isn't part of the NodeVisitor API.
116 def visit_symbol_table(self, symtab: SymbolTable) -> None:
117 for key in symtab:
118 value = symtab[key]
119 cross_ref = value.cross_ref
120 # Fix up module cross-reference eagerly because it is very cheap.
121 if cross_ref is not None:
122 if cross_ref in self.modules:
123 value.cross_ref = None
124 value.unfixed = False
125 value._node = self.modules[cross_ref]
126 # TODO: this should not be needed, looks like a daemon bug.
127 elif self.allow_missing:
128 self.resolve_cross_ref(value)
129 # Look at private attribute to avoid triggering fixup eagerly.
130 elif isinstance(value._node, TypeInfo):
131 self.visit_type_info(value._node)
132 else:
133 value.stored_info = self.current_info
134
135 def resolve_cross_ref(self, value: SymbolTableNode) -> None:
136 """Replace cross-reference with an actual referred node."""

Callers 2

visit_type_infoMethod · 0.95
fix_cross_refsMethod · 0.80

Calls 3

resolve_cross_refMethod · 0.95
visit_type_infoMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected