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

Method valid_unpack_fallback_item

mypy/checkexpr.py:921–927  ·  view source on GitHub ↗
(self, typ: ProperType)

Source from the content-addressed store, hash-verified

919 return True
920
921 def valid_unpack_fallback_item(self, typ: ProperType) -> bool:
922 if isinstance(typ, AnyType):
923 return True
924 if not isinstance(typ, Instance) or not typ.type.has_base("typing.Mapping"):
925 return False
926 mapped = map_instance_to_supertype(typ, self.chk.lookup_typeinfo("typing.Mapping"))
927 return all(isinstance(a, AnyType) for a in get_proper_types(mapped.args))
928
929 def match_typeddict_call_with_dict(
930 self,

Callers 1

Calls 6

get_proper_typesFunction · 0.90
isinstanceFunction · 0.85
allFunction · 0.85
has_baseMethod · 0.80
lookup_typeinfoMethod · 0.45

Tested by

no test coverage detected