(func)
return echo_func
This decorator dumps out the arguments passed to a function before calling it
This decorator dumps out the arguments passed to a function before calling it
This decorator dumps out the arguments passed to a function before calling it
def dump_args(func):
    "This decorator dumps out the arguments passed to a function before calling it"
    argnames = func.func_code.co_varnames[:func.func_code.co_argcount]
    fname = func.func_name
    def echo_func(*args,**kwargs):
        print fname, ":", ', '.join(
            '%s=%r' % entry
            for entry in zip(argnames,args) + kwargs.items())
        return func(*args, **kwargs)
    return echo_func
def dump_args ( func ) : argnames = func . func_code . co_varnames [ : func . func_code . co_argcount ] fname = func . func_name def echo_func ( * args , * * kwargs ) : print fname , ":" , ', ' . join ( '%s=%r' % entry for entry in zip ( argnames , args ) + kwargs . items ( ) ) return func ( * args , * * kwargs ) return echo_func