def wrap_with_arg(f):

    def wrap(*args):
        print('called with %d arguments' % len(args))
f(args)
return wrap

@wrap_with_arg
def baz(arg):
    print('called with argument %r' % arg)
baz(3)
baz(3, 4)
Understanding parameter handling in a python memoization decorator