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

Method note_defined_here

mypy/messages.py:1021–1034  ·  view source on GitHub ↗
(self, callee: CallableType, context: Context)

Source from the content-addressed store, hash-verified

1019 self.note_defined_here(callee, context)
1020
1021 def note_defined_here(self, callee: CallableType, context: Context) -> None:
1022 module = find_defining_module(self.modules, callee)
1023 if (
1024 module
1025 and module.path != self.errors.file
1026 and module.fullname not in ("builtins", "typing")
1027 ):
1028 assert callee.definition is not None
1029 fname = callable_name(callee)
1030 if not fname: # an alias to function with a different name
1031 fname = "Called function"
1032 else:
1033 fname = fname.split(" of ")[0] # use short method names in the note
1034 self.note(f'{fname} defined in "{module.fullname}"', context, code=codes.CALL_ARG)
1035
1036 def duplicate_argument_value(self, callee: CallableType, index: int, context: Context) -> None:
1037 self.fail(

Callers 2

Calls 4

noteMethod · 0.95
find_defining_moduleFunction · 0.85
callable_nameFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected