Python decorator(装饰器)
2014-07-11 16:43
387 查看
#encoding:utf-8 #装饰器 def log(func): def wrapper(*args,**kw): print 'begin call %s():' % func.__name__ func(*args,**kw) print 'end call %s()' % func.__name__ return wrapper @log #应用装饰器 def now(): print "2013-12-25" @log def fun(name): print name now() fun("cui")
相关文章推荐
- 装饰器 decorator (python)
- 深入理解Python 装饰器(decorator)
- Head First 设计模式——装饰器(Decorator Pattern)——Python实现
- Python 装饰器(decorator )的深度解读
- Python 装饰器(Decorator)
- python里为什么需要使用装饰器(decorator)
- python装饰器decorator
- Python装饰器 decorator 设计模式
- 对Python中装饰器(Decorator)的理解与进阶
- 深入理解Python 装饰器(decorator)
- Python中的Decorator(装饰器)模式
- Python如何使用装饰器(Decorator)修改yield function返回值
- 装饰器学习(2)------深入理解Python 装饰器(decorator)
- python decorator(装饰器)
- Python 装饰器( Decorator)
- python 高阶函数:Decorator(装饰器)
- python3 第二十二章 - 函数式编程之Decorator(装饰器)
- Python的walk和Decorator使用一例
- python self,cls,decorator的理解
- 轻量级AOP框架-移植python的装饰器(Decorator)到C#(编码篇)