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

Method annotate

mypyc/annotate.py:411–414  ·  view source on GitHub ↗
(self, o: Node, ann: str | Annotation, priority: int = 1)

Source from the content-addressed store, hash-verified

409 super().visit_lambda_expr(o)
410
411 def annotate(self, o: Node, ann: str | Annotation, priority: int = 1) -> None:
412 if isinstance(ann, str):
413 ann = Annotation(ann, priority=priority)
414 self.anns.setdefault(o.line, []).append(ann)
415
416 def get_type(self, e: Expression) -> ProperType:
417 t = self.type_map.get(e)

Callers 8

visit_func_defMethod · 0.95
check_iterationMethod · 0.95
visit_with_stmtMethod · 0.95
visit_name_exprMethod · 0.95
visit_member_exprMethod · 0.95
visit_call_exprMethod · 0.95
check_isinstance_argMethod · 0.95
visit_lambda_exprMethod · 0.95

Calls 4

isinstanceFunction · 0.85
AnnotationClass · 0.85
appendMethod · 0.80
setdefaultMethod · 0.80

Tested by

no test coverage detected