title: Understanding subclasses and __init__ method
body: <p>I have a question.I'm learning Python and trying to understand superclasses,subclasses and the hierarchy between them.I have one thing that i didn't understand completely.
  I'm trying to write a program where there's a "Person" superclass and "Birthday" subclass.I defined <strong>init</strong> method for both of them.What I want to do is, I want to create an instance of Person.At the same time it should create the same instance for Birthday.Because all people have birthdays :) And  i want to use the methods that i defined in "Birthday" class.
  The code;</p>
  
  <pre><code>import datetime
  class Person(object):
      def __init__(self,name):
          self.name=name
          Birthday.__init__(self,name)
  
      def gender(self,gender):
          self.gender=gender
  
  
  
  class Birthday(Person):
      def __init__(self,name):
          self.objectlike=[]
          self.birthday=None
          self.youget={}
      def setbirth(self,year,month,day):
          self.birthday=datetime.date(year,month,day)        
      def getbirth(self):
          return self.birthday
      def __str__(self):
          return self.name
      def setyouget(self,year,thing):
          self.youget[year]=thing
      def setlikeob(self,thing):
          self.objectlike.append(thing)
      def nextbirth(self):
          thisyearbirth=getbirth().year.replace(year=datetime.date.today().year)
          return thisyearbirth
      def howlong(self):
          return self.nextbirth()-datetime.date.today()
      def getage(self):
          age=datetime.date.today().year-self.birthday.year
          return age
  </code></pre>
  
  <p>The problem is when i create an instance of Person,for example,</p>
  
  <pre><code>joey=Person('Joey Tribiani')
  </code></pre>
  
  <p>Then i try to set a birthday for joey;</p>
  
  <pre><code>joey.setbirth(1980,5,5)
  </code></pre>
  
  <p>It says:'Person' object has no attribute 'setbirth'</p>
  
  <p>How can i overcome this problem? I think i should add some code to <strong>init</strong> methods but i don't know what to add.I added "Birthday.<strong>init</strong>(self,name)" to Person class but it didn't work.</p>
  
  <p>(By the way this is my first question.I read many topics on this website.I'm amazed by how helpful the people using it.)</p>