Look up a definition from the symbol table with the given name.
(self, name: str)
| 7841 | ) |
| 7842 | |
| 7843 | def lookup(self, name: str) -> SymbolTableNode: |
| 7844 | """Look up a definition from the symbol table with the given name.""" |
| 7845 | if name in self.globals: |
| 7846 | return self.globals[name] |
| 7847 | else: |
| 7848 | b = self.globals.get("__builtins__", None) |
| 7849 | if b: |
| 7850 | assert isinstance(b.node, MypyFile) |
| 7851 | table = b.node.names |
| 7852 | if name in table: |
| 7853 | return table[name] |
| 7854 | raise KeyError(f"Failed lookup: {name}") |
| 7855 | |
| 7856 | def lookup_qualified(self, name: str) -> SymbolTableNode: |
| 7857 | if "." not in name: |