草庐IT

python - 在 Python 中从子类访问父类中的装饰器

如何从子类的基类访问装饰器?我(错误地)假设ffg.会工作:classbaseclass(object):def__init__(self):print'heythisisthebase'def_deco(func):defwrapper(*arg):res=func(*arg)print'I\'madecorator.Thisisfabulous,butthatcolour,solastseasonsweetiedarling'returnresreturnwrapper@_decodefbasefunc(self):print'I\'mabasefunction'这个类工作正常,但