标签:
#!/usr/bin/env python
#_*_coding=utf-8_*_
#Author: xieyixue
#mail: xyx_0410@163.com
#Created Time: 2015年07月01日 星期三 01时30分36秒
class staticClass:
def __init__(self):
print "初始化"
@staticmethod
def before():
print "before"
@staticmethod
def after():
print "after"
def deco_class(arg_class):
def deco_fun(*arg,**kwarg):
def _deco_fun(*arg,**kwarg):
arg_class.before()
ret = deco_fun(*arg,**kwarg)
arg_class.after()
return ret
return _deco_fun
return deco_fun
@deco_class(staticClass)
def fun1(a):
print a
print ‘======为什么没打印啊‘
fun1(‘xixi‘)
标签:
原文地址:http://www.cnblogs.com/xyx-py/p/4612211.html