class A: def __init__(self): print(\"world\") class B(A): def __init__(self): print(\"hello\") B() # output: hello
In all
super() returns a parent-like object in new-style classes:
super()
class A(object): def __init__(self): print("world") class B(A): def __init__(self): print("hello") super(B, self).__init__() B()