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

Method check_protocol_issubclass

mypy/checkexpr.py:765–771  ·  view source on GitHub ↗
(self, e: CallExpr)

Source from the content-addressed store, hash-verified

763 self.chk.fail(message_registry.RUNTIME_PROTOCOL_EXPECTED, e)
764
765 def check_protocol_issubclass(self, e: CallExpr) -> None:
766 for expr in mypy.checker.flatten(e.args[1]):
767 tp = get_proper_type(self.chk.lookup_type(expr))
768 if isinstance(tp, FunctionLike) and tp.is_type_obj() and tp.type_object().is_protocol:
769 attr_members = non_method_protocol_members(tp.type_object())
770 if attr_members:
771 self.chk.msg.report_non_method_protocol(tp.type_object(), attr_members, e)
772
773 def check_typeddict_call(
774 self,

Callers 1

visit_call_expr_innerMethod · 0.95

Calls 7

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85
lookup_typeMethod · 0.45
is_type_objMethod · 0.45
type_objectMethod · 0.45

Tested by

no test coverage detected