Python, invoke super constructor

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-08T04:35:17Z Indexed on 2010/03/08 4:36 UTC
Read the original article Hit count: 232

Filed under:
|
|
class A:
 def __init__(self):
   print "world"

class B(A):
 def __init__(self):
   print "hello"

B()
hello

In all other languages I've worked with the super constructor is invoked implicitly. How does one invoke it in Python? I would expect super(self) but this doesn't work

© Stack Overflow or respective owner

Related posts about python

Related posts about class