title: Is it possible to pass object arguments backwards?
body: <p>I have two object classes: <code>class Hero(object):</code> and <code>class Alien(object)</code> each with a <code>name</code> parameter that contains the name of the object instance. In each class I have a class method called <code>def die(self):</code> which defines what happens when the Hero is hit or not hit. While I am able to reference the object inside itself, I'm having trouble doing the backwards operation, which is referencing the object that references the method. Sorry if this is confusing, here is what I mean:</p>
  
  <pre><code>#this die and blast function is contained in both classes
  def die(self):    
      #(pseudocode) if hit:
          print (self.name, " is hit!")
      #(pseudocode) elif not hit:
          print (enemy.name, " misses!") #&lt;-- currently doesn't work because enemy is not defined in the die function
  def blast(self, enemy):
      print(self.name," blasts ", enemy.name, "\n")
      enemy.die()
  
  def main():
      heroObject = Hero()
      alienObject = Alien()
      heroObject.blast(alienObject)
  </code></pre>
  
  <p>Here's my question: I know that when I call <code>blast()</code> that I use the name of the object as the argument. But inside of the <code>blast()</code> and <code>die()</code> functions, how can I call the name of the object that originally called it? The line <code>print (enemy.name, " misses!")</code> doesn't currently work because <code>enemy</code> is not defined in the <code>die</code> function. Ideally what would happen is the name of the enemy would appear in the <code>print</code> statement.</p>