function wrapper with variable number of arguments python

82

def dec(function):
    def _wrapper(*args, **kwargs):
        print len(args) + len(kwargs)
        return function(*args, **kwargs)
    return _wrapper

Comments

Submit
0 Comments