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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -