1def foo(a, b=3, *args, **kwargs):
2 defaultKwargs = { 'c': 10, 'd': 12 }
3 kwargs = { **defaultKwargs, **kwargs }
4 print(a, b, args, kwargs)
5
6 # Do something
7
8foo(1) # 1 3 () {'c': 10, 'd': 12}
9foo(1, d=5) # 1 3 () {'c': 10, 'd': 5}
10foo(1, 2, 4, d=5) # 1 2 (4,) {'c': 10, 'd': 5}
11