Discuss / Python / 廖老师真的不算基础啊

廖老师真的不算基础啊

Topic source

Galaxy_言叶

#1 Created at ... [Delete] [Delete and Lock User]
import functoolsdef log(func):    @functools.wraps(func)    def wrapper(*args,**kw):        print('%s begin call' % func.__name__)        result = func(*args,**kw)        print('%s end call' % func.__name__)        return result    return wrapper@logdef a(x,y):    print('%s is running' % a.__name__)    return x+yprint(a(1,2))

  • 1

Reply