当我创建如下所示的父类和子类时,为什么父类中的参数不被子类自动拉入?在
我明白显式更好,但是我想知道在什么情况下这个代码。。。在
class testParent(object):
def __init__(self,testParentParam1,testParentParam2):
pass
class testChild(testParent):
def __init__(self,testParentParam1,testParentParam2,testChildParam1,testChildParam2):
pass
比这个代码好。。。在
^{pr2}$
派生类扩展基类。他们可能需要更多的信息。考虑:
相关问题 更多 >
编程相关推荐