getattr
calls method by name from an object.But this object should be parent of calling class.The parent class can be got by super(self.__class__, self)
class Base: def call_base(func):"""This does not work""" def new_func(self, *args, **kwargs): name = func.__name__ getattr(super(self.__class__, self), name)(*args, **kwargs) return new_func def f(self, *args): print(f"BASE method invoked.") def g(self, *args): print(f"BASE method invoked.")class Inherit(Base): @Base.call_base def f(self, *args):"""function body will be ignored by the decorator.""" pass @Base.call_base def g(self, *args):"""function body will be ignored by the decorator.""" passInherit().f() # The goal is to print "BASE method invoked."