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

Method has_type

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

Source from the content-addressed store, hash-verified

7810 self._type_maps[-1][node] = typ
7811
7812 def has_type(self, node: Expression) -> bool:
7813 return any(node in m for m in reversed(self._type_maps))
7814
7815 def lookup_type_or_none(self, node: Expression) -> Type | None:
7816 for m in reversed(self._type_maps):

Callers 9

visit_assignment_stmtMethod · 0.95
visit_decorator_innerMethod · 0.95
is_len_of_tupleMethod · 0.95
literal_int_exprMethod · 0.95
visit_call_expr_innerMethod · 0.80
check_str_format_callMethod · 0.80
visit_lambda_exprMethod · 0.80

Calls 2

anyFunction · 0.85
reversedFunction · 0.85

Tested by

no test coverage detected