MCPcopy Create free account
hub / github.com/python/mypy / visit_call_expr

Method visit_call_expr

mypy/server/deps.py:738–747  ·  view source on GitHub ↗
(self, e: CallExpr)

Source from the content-addressed store, hash-verified

736 break
737
738 def visit_call_expr(self, e: CallExpr) -> None:
739 if isinstance(e.callee, RefExpr) and e.callee.fullname == "builtins.isinstance":
740 self.process_isinstance_call(e)
741 else:
742 super().visit_call_expr(e)
743 typ = self.type_map.get(e.callee)
744 if typ is not None:
745 typ = get_proper_type(typ)
746 if not isinstance(typ, FunctionLike):
747 self.add_attribute_dependency(typ, "__call__")
748
749 def process_isinstance_call(self, e: CallExpr) -> None:
750 """Process "isinstance(...)" in a way to avoid some extra dependencies."""

Callers 2

visit_assignment_stmtMethod · 0.45

Calls 5

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected