#!/usr/bin/env python#_*_coding=utf-8_*_#Author: xieyixue#mail: [email protected]#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‘)
时间: 2024-10-14 02:40:36