gpt4 book ai didi

python - 为什么 super().__init__ 没有自引用?

转载 作者:行者123 更新时间:2023-12-05 02:55:23 27 4
gpt4 key购买 nike

<分区>

为什么我们在使用 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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com