I known the python defined two type method arguments:
- position arguments
- keyword arguments
and position arguments can divided into three types:
- plain position arguments
- default arguments
- variable arguments
Similarly, the keyword arguments divided below three types:
- optional (keyword) arguments
- named keyword arguments
- plain keyword arguments
So, I defined a method:
def method(a, b=1, *c, d = 'default', e, **f)
print(a, b, c, d, e, f)
I have some confusion:
In the calling method, whether can use the keyword arguments for position arguments, such as:
method(b=2, a=1, c=[1,2,3], e=4)
I think the default parameters can replace named keyword, but why introduce optional (keyword) arguments?
My understanding is there a problem?