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

Method lookup_type

mypy/checker.py:7821–7826  ·  view source on GitHub ↗
(self, node: Expression)

Source from the content-addressed store, hash-verified

7819 return None
7820
7821 def lookup_type(self, node: Expression) -> Type:
7822 for m in reversed(self._type_maps):
7823 t = m.get(node)
7824 if t is not None:
7825 return t
7826 raise KeyError(node)
7827
7828 def store_types(self, d: dict[Expression, Type]) -> None:
7829 self._type_maps[-1].update(d)

Calls 3

reversedFunction · 0.85
KeyErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected