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

Method suggest

mypy/suggestions.py:274–285  ·  view source on GitHub ↗

Suggest an inferred type for function.

(self, function: str)

Source from the content-addressed store, hash-verified

272 self.use_fixme = use_fixme
273
274 def suggest(self, function: str) -> str:
275 """Suggest an inferred type for function."""
276 mod, func_name, node = self.find_node(function)
277
278 with self.restore_after(mod):
279 with self.with_export_types():
280 suggestion = self.get_suggestion(mod, node)
281
282 if self.give_json:
283 return self.json_suggestion(mod, func_name, node, suggestion)
284 else:
285 return self.format_signature(suggestion)
286
287 def suggest_callsites(self, function: str) -> str:
288 """Find a list of call sites of function."""

Callers 1

cmd_suggestMethod · 0.95

Calls 6

find_nodeMethod · 0.95
restore_afterMethod · 0.95
with_export_typesMethod · 0.95
get_suggestionMethod · 0.95
json_suggestionMethod · 0.95
format_signatureMethod · 0.95

Tested by

no test coverage detected