MCPcopy Index your code
hub / github.com/RustPython/RustPython / _missing_arguments

Function _missing_arguments

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

Source from the content-addressed store, hash-verified

1385 return '(' + ', '.join(specs) + ')'
1386
1387def _missing_arguments(f_name, argnames, pos, values):
1388 names = [repr(name) for name in argnames if name not in values]
1389 missing = len(names)
1390 if missing == 1:
1391 s = names[0]
1392 elif missing == 2:
1393 s = "{} and {}".format(*names)
1394 else:
1395 tail = ", {} and {}".format(*names[-2:])
1396 del names[-2:]
1397 s = ", ".join(names) + tail
1398 raise TypeError("%s() missing %i required %s argument%s: %s" %
1399 (f_name, missing,
1400 "positional" if pos else "keyword-only",
1401 "" if missing == 1 else "s", s))
1402
1403def _too_many(f_name, args, kwonly, varargs, defcount, given, values):
1404 atleast = len(args) - defcount

Callers 1

getcallargsFunction · 0.85

Calls 4

reprFunction · 0.85
lenFunction · 0.85
formatMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected