How to use the __init__ from the main object class in an inherited class?
<p>I have a program that I will be using inheritance in:</p>

<pre><code>class Templates(object):

    def __init__(self, esd_user, start_date,
                 summary, ticket_number, email_type):
        self.esd = esd_user
        self.strt_day = start_date
        self.sum = summary
        self.ticket = ticket_number
        self.email = email_type

    def gather_intel(self):
        if self.email == "pend":
            PendingEmail(self.esd, self.ticket,
                         self.strt_day)
        elif self.email == "generic":
            GenericEmail(self.esd, self.ticket,
                         self.strt_day)
        elif self.email == "resolve":
            ResolveEmail(self.esd, self.ticket,
                         self.strt_day)
        elif self.email == "osha":
            OshaEmail(self.esd, self.ticket,
                      self.strt_day)
        else:
            return False


class PendingEmail(Templates):
    pass


class GenericEmail(Templates):
    pass


class ResolveEmail(Templates):
    pass


class OshaEmail(Templates):
    pass
</code></pre>

<p>Is it possible for me to use the <code>__init__</code> from the <code>Templates</code> class as the <code>__init__</code> for the other inherited classes, without having to rewrite the <code>__init__</code> method? Would a call to <code>super</code> be necessary here?</p>

<p>For example, is this the proper way to inherit the <code>__init__</code> function from the main <code>Templates</code> class?</p>

<pre><code>class PendingEmail(Templates):

    def __init__(self):
        super(Templates, self).__init__()
</code></pre>

<p>If you don't need to add anything to the <code>__init__</code> for the subclasses, just don't implement it, and they'll inherit it automatically. Otherwise, you're a little off for cases where you need to do further initialization:</p>

<pre><code>class PendingEmail(Templates):

    def __init__(self):
        super(PendingEmail, self).__init__()  # Name your own class, not the super class
</code></pre>

python python-2.7 oop inheritance