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

Method format_type

mypy/suggestions.py:758–761  ·  view source on GitHub ↗
(self, cur_module: str | None, typ: Type)

Source from the content-addressed store, hash-verified

756 return f"({', '.join(sig['arg_types'])}) -> {sig['return_type']}"
757
758 def format_type(self, cur_module: str | None, typ: Type) -> str:
759 if self.use_fixme and isinstance(get_proper_type(typ), AnyType):
760 return self.use_fixme
761 return typ.accept(TypeFormatter(cur_module, self.graph, self.manager.options))
762
763 def score_type(self, t: Type, arg_pos: bool) -> int:
764 """Generate a score for a type that we use to pick which type to use.

Callers 2

format_argsMethod · 0.95
pyannotate_signatureMethod · 0.95

Calls 4

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85
TypeFormatterClass · 0.85
acceptMethod · 0.45

Tested by

no test coverage detected