On Tue, 22 Jul 2008 09:35:58 -0700, Matimus wrote: > On Jul 22, 9:26 am, Catherine Heathcote > <[EMAIL PROTECTED]> wrote: >> If I create a new class inherited from another with a constructor, what >> happens with the new class's constructer? >> Thanks for your time. > > Nothing, unless you call it in your constructor. > > class Base(object): > def __init__(self): > print "Base constructor called" > > # without calling the base class constructor > class C(Base): > def __init__(self): > print "C constructor called" > > # call the base class constructor using super > class D(Base): > def __init__(self): > super(D, self).__init__() > print "D constructor called" > > c = C() > d = D() > > > Matt
Aha! Makes sence, thankyou. As you can probably tell I am new to Python, but not programming as a whole. -- http://mail.python.org/mailman/listinfo/python-list