class A: def __init__(self): print(\"world\") class B(A): def __init__(self): print(\"hello\") B() # output: hello
In all
With Python 2.x old-style classes it would be this:
class A: def __init__(self): print "world" class B(A): def __init__(self): print "hello" A.__init__(self)