摘要: 直接上代码,这个例子是从《The Quick Python Book 2ed》里面抄出来的,代码是Python3的。不用decorator的代码1 def myfunction(parameter):2 print(parameter[0])3 4 myfunction("hello")输出如下h使用decorator的代码 1 def dec123(func): 2 print("in decorate function, decorating", func.__name__) 3 4 def wrapper_func(*args): 5 print. 阅读全文
posted @ 2013-12-24 13:27 valleylord 阅读(305) 评论(0) 推荐(0) 编辑