title: Can't call child class method from parent class
body: <p>I was wondering if someone can tell me the error. Why I can't access the child class method from the parent class. Thank you!</p>
  <p>Code is about a game where we have a soldier and his inventory. I try to call Soldier().add_weapon but it returns an error that no add_weapon exists for Soldier</p>
  <p>Code:</p>
  <pre><code>class Soldier():
      def __init__(self, name, price, health=100, kills=0, type='human'):
  
          assert price &gt;= 0 
          assert health &gt;= 0 
          assert kills &gt;= 0
          assert type is 'human' or 'air' or 'ground'
          #assert inventory 
  
          self.name = name
          self.price = price
          self.health = health
          self.kills = kills
          self.type = type
  
      @property
      def get_name(self):
          return self._name
  
      @get_name.setter
      def set_name(self, value):
          self._name = value
  
      def get_health(self):
          return self.health
  
      def set_health(self, value):
          self.health = value
  
      def face_damage(self, value):
          self.health = self.health - int(value)
  
      def is_alive(self):
          if self.health &gt; 0:
              return True
          else:
              return False
  
      def get_inventory(self):
          pass
  
  class Inventory(Soldier):
  
      def __init__(self):
  
          super().__init__(
              
          )
      
          self.inv = []
      
      def add_weapon(self, item):
          
          if item not in self.inv:
  
              self.inv.append(item)
          
          else: None
  
      def get_total_attack(self, weapon_specs = {
       'rifle': {'air': 1, 'ground': 2, 'human': 5},
       'pistol': {'air': 0, 'ground': 1, 'human': 3},
       'rpg': {'air': 5, 'ground': 5, 'human': 3},
       'warhead': {'air': 10, 'ground': 10, 'human': 10},
       'machine gun': {'air': 3, 'ground': 3, 'human': 10}
       }):
       
          damages = {}
          for weapon in self.inv:
              for k,v in weapon_specs[weapon].items():
                  damages[k] = damages.get(k, 0) + v
          
          return damages
  
      '''
      def get_inventory(self):
          for x in self.inv:
              return x
      '''
  
      def attack(self, value, total):
          for i in self.inv:
              for k in total:
                  return total[k]
          
  
  
  def test_p2_4():
    soldier = Soldier('ranger', 100)
    soldier.add_weapon('rifle')
    soldier.add_weapon('machine gun')
    soldier.add_weapon('rpg')
    inventory = soldier.get_inventory()
    damages = inventory.get_total_attack()
    correct = damages['air'] == 9 and damages['ground'] == 10 and damages['human'] == 18
    assert correct
    return &quot;Passed!&quot;
  
  
  print(test_p2_4())
  </code></pre>
  <p>Error I get
  :</p>
  <p>AttributeError: 'Soldier' object has no attribute 'add_weapon'</p>