[Tutor] Using superclass __init__ method

Jan Eden lists at janeden.org
Thu Sep 22 16:48:44 CEST 2005


Hi,

paul brian wrote on 22.09.2005:

>
>class Base:
>   def __init__(self):
>       print "hello"
>
>class Child(Base):
>   def __init__(self):
>       Base.__init__(self)
>

This is how I did it so far. But in my program, I have 10 subclasses with identical __init__ methods, so I can simplify the setup a lot.

Thanks for your help,

Jan
-- 
Alcohol and calculus don't mix - PLEASE don't drink and derive.


More information about the Tutor mailing list