Args Kwargs arugments
py
def aaa(*args,**kwargs):
"""aaa
:param args: List argument here
:param kwargs: Dict arguments here
"""
# expected
print(f"{args}") # ('param0', 'param1')
print(f"{kwargs}") # {'param2': 'param2', 'param3': 'param3'}
aaa("param0", "param1", param2="param2", param3="param3")
## Mixed kwargs and named args
Example:
a =
def aaa(a, b, c): print(a) print(b) print(c)
aaa(**a, c='sss') # avoid doing this, because this will not work on py2 but will work in py3
aaa(c='sss', **a) # this will work on both py2 and py3