I always thought
I looked at sorted function code didn't find any use of
May be it is to differentiate positional or keyword arguments.
may be to represent that after
Just a theory, let me know if you find a counter-example.
Ok so i tried to use
*
was for unpacking, but that's surely not the case here.I looked at sorted function code didn't find any use of
*
(except for the pointers in C).May be it is to differentiate positional or keyword arguments.
func(positional args,*, keyword args)
may be to represent that after
,*,
no positional argument could be there.Just a theory, let me know if you find a counter-example.
Ok so i tried to use
,*,
in function defination and all it did is convert the argument on right to keyword argument.>>> def myFunction(a, *, b): ... return a+b ... >>> myFunction(3,5) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: myFunction() takes 1 positional argument but 2 were given >>> myFunction(3,b=5) 8