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

Method incompatible_argument_note

mypy/messages.py:818–853  ·  view source on GitHub ↗
(
        self,
        original_caller_type: ProperType,
        callee_type: ProperType,
        context: Context,
        parent_error: ErrorInfo,
    )

Source from the content-addressed store, hash-verified

816 return error
817
818 def incompatible_argument_note(
819 self,
820 original_caller_type: ProperType,
821 callee_type: ProperType,
822 context: Context,
823 parent_error: ErrorInfo,
824 ) -> None:
825 if self.prefer_simple_messages():
826 return
827 if isinstance(
828 original_caller_type, (Instance, TupleType, TypedDictType, TypeType, CallableType)
829 ):
830 if isinstance(callee_type, Instance) and callee_type.type.is_protocol:
831 self.report_protocol_problems(
832 original_caller_type, callee_type, context, parent_error=parent_error
833 )
834 if isinstance(callee_type, UnionType):
835 for item in callee_type.items:
836 item = get_proper_type(item)
837 if isinstance(item, Instance) and item.type.is_protocol:
838 self.report_protocol_problems(
839 original_caller_type, item, context, parent_error=parent_error
840 )
841 if isinstance(callee_type, CallableType) and isinstance(original_caller_type, Instance):
842 call = find_member(
843 "__call__", original_caller_type, original_caller_type, is_operator=True
844 )
845 if call:
846 self.note_call(original_caller_type, call, context, code=parent_error.code)
847 if isinstance(callee_type, Instance) and callee_type.type.is_protocol:
848 call = find_member("__call__", callee_type, callee_type, is_operator=True)
849 if call:
850 self.note_call(callee_type, call, context, code=parent_error.code)
851 self.maybe_note_concatenate_pos_args(
852 original_caller_type, callee_type, context, parent_error.code
853 )
854
855 def maybe_note_concatenate_pos_args(
856 self,

Callers 1

check_argMethod · 0.80

Calls 7

note_callMethod · 0.95
get_proper_typeFunction · 0.90
find_memberFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected