当我们使用super().__init__?
(例如下面的第9行)时,为什么不需要自引用呢
class labourers():
def __init__(self,name,department,salary):
self.name = name
self.department = department
self.salary = salary
class managers(labourers):
def __init__(self,name,department,salary,numberofpeople):
super().__init__(name,department,salary)
self.numberofpeople = numberofpeople
Super在本例中的功能是在CPython解析器中实现的。见PEP 3135
重点补充
相关问题 更多 >
编程相关推荐