class A: def a(self, params): print("I from a, params is {}".format(params)) @staticmethod def b(params): print("I from b, params is {}".format(params)) @classmethod def c(cls, params): print("I from c, params is {}".format(params)) def d(params): print("I from d, params is {}".format(params)) demo = A() getattr(demo, "a")("a") getattr(A, "b")("b") getattr(A, "c")("c") setattr(demo, "d", d) getattr(demo, "d")("d")