Remove all imported names from the symbol table of a module.
(names: SymbolTable, module: str)
| 8248 | |
| 8249 | |
| 8250 | def remove_imported_names_from_symtable(names: SymbolTable, module: str) -> None: |
| 8251 | """Remove all imported names from the symbol table of a module.""" |
| 8252 | removed: list[str] = [] |
| 8253 | for name, node in names.items(): |
| 8254 | if node.node is None: |
| 8255 | continue |
| 8256 | fullname = node.node.fullname |
| 8257 | prefix = fullname[: fullname.rfind(".")] |
| 8258 | if prefix != module: |
| 8259 | removed.append(name) |
| 8260 | for name in removed: |
| 8261 | del names[name] |
| 8262 | |
| 8263 | |
| 8264 | def make_any_non_explicit(t: Type) -> Type: |
no test coverage detected
searching dependent graphs…