How to dynamically change signatures of method in subclass?
问题 When using classmethod to dynamic change the method in subclass, how to dynamic change signatures of method? example import inspect class ModelBase(object): @classmethod def method_one(cls, *args): raise NotImplementedError @classmethod def method_two(cls, *args): return cls.method_one(*args) + 1 class SubClass(ModelBase): @staticmethod def method_one(a, b): return a + b test = SubClass() try: print(inspect.signature(test.method_two)) except AttributeError: print(inspect.getargspec(test