MCPcopy Index your code
hub / github.com/python/cpython / _missing_arguments

Function _missing_arguments

Lib/inspect.py:1411–1425  ·  view source on GitHub ↗
(f_name, argnames, pos, values)

Source from the content-addressed store, hash-verified

1409 return '(' + ', '.join(specs) + ')'
1410
1411def _missing_arguments(f_name, argnames, pos, values):
1412 names = [repr(name) for name in argnames if name not in values]
1413 missing = len(names)
1414 if missing == 1:
1415 s = names[0]
1416 elif missing == 2:
1417 s = "{} and {}".format(*names)
1418 else:
1419 tail = ", {} and {}".format(*names[-2:])
1420 del names[-2:]
1421 s = ", ".join(names) + tail
1422 raise TypeError("%s() missing %i required %s argument%s: %s" %
1423 (f_name, missing,
1424 "positional" if pos else "keyword-only",
1425 "" if missing == 1 else "s", s))
1426
1427def _too_many(f_name, args, kwonly, varargs, defcount, given, values):
1428 atleast = len(args) - defcount

Callers 1

getcallargsFunction · 0.85

Calls 2

formatMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…