def f1(a, b, c=0, *args, **kw):
print("a =", a, "b =", b, "c =", c, "args =", args, "kw =", kw)
args = (1, 2, 3, 4)
kw = {"d": 99, "x": "-sharp"}
f1(*args, **kw)
the result is a = 1 b = 2 c = 3 args = (4,) kw = {"dink: 99," x sharp":"- sharp"}
here I think the reason for reporting an error is as follows:
a, b, c is a position parameter, args is a variable parameter, and * kw is a keyword parameter. Code
f1(*args, **kw)
only passes variable parameters and keyword parameters, but does not pass the three position parameters of a _ c. So as far as I understand it, the program should report an error, but this is not the case. And ask the god for advice