我在SamplePArent类中有一个抽象方法
Class SampleParent
@abc.abstractmethod
def getData(Self, **kwargs)
它在3个不同的子类(A、B和C)中实现。在所有三个子类中,getData方法采用不同的参数。你知道吗
父类以及所有3个子类中getData方法的参数列表将是什么,以便保留抽象的概念。你知道吗
Class A
def getData(self,null) # takes no parameter
Class B
def getData(self, count) # takes integer value as a parameter
Class C
def getData(self, name_dict) # takes dictionary as a parameter
所有函数定义的参数列表是否正确。我在parent方法中给出了**kwargs,因为它的3个实现方法都采用了不同类型的参数或没有参数。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐