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

Method format_args

mypy/suggestions.py:522–540  ·  view source on GitHub ↗
(
        self,
        arg_kinds: list[list[ArgKind]],
        arg_names: list[list[str | None]],
        arg_types: list[list[Type]],
    )

Source from the content-addressed store, hash-verified

520 return self.pyannotate_signature(mod, is_method, best)
521
522 def format_args(
523 self,
524 arg_kinds: list[list[ArgKind]],
525 arg_names: list[list[str | None]],
526 arg_types: list[list[Type]],
527 ) -> str:
528 args: list[str] = []
529 for i in range(len(arg_types)):
530 for kind, name, typ in zip(arg_kinds[i], arg_names[i], arg_types[i]):
531 arg = self.format_type(None, typ)
532 if kind == ARG_STAR:
533 arg = "*" + arg
534 elif kind == ARG_STAR2:
535 arg = "**" + arg
536 elif kind.is_named():
537 if name:
538 arg = f"{name}={arg}"
539 args.append(arg)
540 return f"({', '.join(args)})"
541
542 def find_node(self, key: str) -> tuple[str, str, FuncDef]:
543 """From a target name, return module/target names and the func def.

Callers 1

suggest_callsitesMethod · 0.95

Calls 7

format_typeMethod · 0.95
rangeClass · 0.85
lenFunction · 0.85
zipFunction · 0.85
is_namedMethod · 0.80
appendMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected