例如:
创建一个将从另一个类继承所有方法和属性的类:
class Parent:
    def __init__(self, txt):
        self.message = txt
    def printmessage(self):
        print(self.message)
class Child(Parent):
    def __init__(self, txt):
        super().__init__(txt)
x = Child("Hello, and welcome!")
x.printmessage()1、定义和用法
super()函数用于提供对父类或兄弟类的方法和属性的访问。
super()函数返回一个代表父类的对象。
Python3.x 和 Python2.x 的一个区别是: Python 3 可以使用直接使用 super().xxx 代替 super(Class, self).xxx :
2、调用语法
super()
3、参数说明
没有参数