class Dec(object): @staticmethod def fundec(fun): print('1') def _fundec(*keys): print('2') fun(*keys) print('3') print('4') return _fundec @staticmethod def fundec1(fun): print('1-A') def _fundec1(*keys): print('2-A') fun(*keys) print('3-A') print('4-A') return _fundec1 class Myclass(object): def __init__(self): print("初始化") @Dec.fundec1 @Dec.fundec def fun(self): print('5') if __name__ == '__main__': ins = Myclass() ins.fun()