from decorator import decorator

@decorator
def trace(f, *args, **kw):
    r = f(*args, **kw)
    print "%s(%s, %s) = %s" % (f.func_name, args, kw, r)
    return r

from decorator import decorator

@decorator
def trace(f, *args, **kw):
    try:
        r = f(*args, **kw)
    finally:
        print "%s(%s, %s) = %s" % (f.func_name, args, kw, r)
    return r

Make our trace decorator a bit more robust
Make our trace decorator a bit more robust
