(self: SymbolTable, cfg: Config)
| 95 | |
| 96 | |
| 97 | def 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 | |
| 119 | def convert_symbol_table_node(self: SymbolTableNode, cfg: Config) -> Json: |
no test coverage detected
searching dependent graphs…