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继承的区别这次没空看了,下次再更新

你可能感兴趣的:(python继承中super的问题)