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

Method get_callsites

mypy/suggestions.py:423–435  ·  view source on GitHub ↗

Find all call sites of a function.

(self, func: FuncDef)

Source from the content-addressed store, hash-verified

421 return [refine_callable(base, base.copy_modified(arg_types=list(x))) for x in product]
422
423 def get_callsites(self, func: FuncDef) -> tuple[list[Callsite], list[str]]:
424 """Find all call sites of a function."""
425 new_type = self.get_starting_type(func)
426
427 collector_plugin = SuggestionPlugin(func.fullname)
428
429 self.plugin._plugins.insert(0, collector_plugin)
430 try:
431 errors = self.try_type(func, new_type)
432 finally:
433 self.plugin._plugins.pop(0)
434
435 return collector_plugin.mystery_hits, errors
436
437 def filter_options(
438 self, guesses: list[CallableType], is_method: bool, ignore_return: bool

Callers 2

suggest_callsitesMethod · 0.95
get_suggestionMethod · 0.95

Calls 5

get_starting_typeMethod · 0.95
try_typeMethod · 0.95
SuggestionPluginClass · 0.85
insertMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected