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

Method record_call_target_precision

mypy/stats.py:262–271  ·  view source on GitHub ↗

Record precision of formal argument types used in a call.

(self, o: CallExpr)

Source from the content-addressed store, hash-verified

260 self.record_call_target_precision(o)
261
262 def record_call_target_precision(self, o: CallExpr) -> None:
263 """Record precision of formal argument types used in a call."""
264 if not self.typemap or o.callee not in self.typemap:
265 # Type not available.
266 return
267 callee_type = get_proper_type(self.typemap[o.callee])
268 if isinstance(callee_type, CallableType):
269 self.record_callable_target_precision(o, callee_type)
270 else:
271 pass # TODO: Handle overloaded functions, etc.
272
273 def record_callable_target_precision(self, o: CallExpr, callee: CallableType) -> None:
274 """Record imprecision caused by callee argument types.

Callers 1

visit_call_exprMethod · 0.95

Calls 3

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected