python继承中super的问题

super() can be used only in the new-style classes, which means the root class needs to inherit from the 'object' class.

For example, the top class need to be like this:

class SomeClass(object):
    def __init__(self):
        ....

not

class SomeClass():
    def __init__(self):
        ....

关于普通继承和super继承的区别这次没空看了,下次再更新

猜你喜欢

转载自blog.csdn.net/ti_tantbx/article/details/39133543
今日推荐