“asterisk args” — I feel these features are optional in most cases. I think they can create additional maintenance work. So perhaps no need to use these features in my own code.
However, some codebases use these features so we had better understand the syntax rules.
— Inside the called function astFunc(),
Most common way to access the args is a for-loop.
It’s also common to forward these asterisk arguments:
def astFunc(*args, **kwargs):
I also tested reading the q[ *args ] via list(args) or args[:]
— how to use these features when calling a function:
- astFunc(**myDict) # astFunc(**kwa)
- simpleFunc(**myDict) # simpleFunc(arg1, arg2) can also accept **myDict
See my github