arguments - Python callable to define args, kwargs as a tuple -
arguments - Python callable to define args, kwargs as a tuple -
is there library or callable lets following?
args, kwargs = get_args(true, 'seven', blah=none, x='y')
so that
args == [true, 'seven'] kwargs == {'blah': none, 'x': 'y'}
i guess google foo weak. certainly built python, cannot find such thing.
there's no built-in, create own:
def get_args(*args, **kwargs): homecoming args, kwargs
the *
(splat) operator unpacking arguments this- it's simple wrap in function.
python arguments
Comments
Post a Comment