class StaticMethod: def __init__(self,fn): print(fn) self.fn = fn def __get__(self, instance, owner): print(self,instance,owner) return self.fn class A: @StaticMethod # foo = StaticMethod(foo),这是一个描述器 def foo(): # print('static') f = A.foo print(f)