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

Function convert_symbol_table

mypy/exportjson.py:97–116  ·  view source on GitHub ↗
(self: SymbolTable, cfg: Config)

Source from the content-addressed store, hash-verified

95
96
97def convert_symbol_table(self: SymbolTable, cfg: Config) -> Json:
98 data: dict[str, Any] = {".class": "SymbolTable"}
99 for key, value in self.items():
100 # Skip __builtins__: it's a reference to the builtins
101 # module that gets added to every module by
102 # SemanticAnalyzerPass2.visit_file(), but it shouldn't be
103 # accessed by users of the module.
104 if key == "__builtins__" or value.no_serialize:
105 continue
106 if not cfg.implicit_names and key in {
107 "__spec__",
108 "__package__",
109 "__file__",
110 "__doc__",
111 "__annotations__",
112 "__name__",
113 }:
114 continue
115 data[key] = convert_symbol_table_node(value, cfg)
116 return data
117
118
119def convert_symbol_table_node(self: SymbolTableNode, cfg: Config) -> Json:

Callers 2

convert_type_infoFunction · 0.85

Calls 2

itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…