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

Method get_partial_var

mypy/checkexpr.py:1160–1169  ·  view source on GitHub ↗
(self, ref: RefExpr)

Source from the content-addressed store, hash-verified

1158 self.chk.replace_partial_type(var, new_type, partial_types)
1159
1160 def get_partial_var(self, ref: RefExpr) -> tuple[Var, dict[Var, Context]] | None:
1161 var = ref.node
1162 if var is None and isinstance(ref, MemberExpr):
1163 var = self.get_partial_self_var(ref)
1164 if not isinstance(var, Var):
1165 return None
1166 partial_types = self.chk.find_partial_types(var)
1167 if partial_types is None:
1168 return None
1169 return var, partial_types
1170
1171 def try_infer_partial_value_type_from_call(
1172 self, e: CallExpr, methodname: str, var: Var

Callers 1

Calls 3

get_partial_self_varMethod · 0.95
isinstanceFunction · 0.85
find_partial_typesMethod · 0.80

Tested by

no test coverage detected