title: Learn Python, exercise 6.7
body: <p>I'm reading Lutz &amp; Ascher - Learn Python and I found this as a solution to one of the exercises:</p>
  
  <pre><code>class Lunch:
    def __init__(self):
      self.cust = Customer()
      self.empl = Employee()
    def order(self, foodName):
      # start a Customer order simulation
      self.cust.placeOrder(foodName, self.empl)
    def result(self):
      # ask the Customer what kind of Food it has
      self.cust.printFood()
  
  class Customer:
    def __init__(self):
      # initialize my food to None
      self.food = None
    def placeOrder(self, foodName, employee):
      # place order with an Employee
      self.food = employee.takeOrder(foodName)
    def printFood(self):
      # print the name of my food
      print self.food.name
  
  class Employee:
    def takeOrder(self, foodName):
      # return a Food, with requested name
      return Food(foodName)
  
  class Food:
    def __init__(self, name):
      # store food name
      self.name = name
  
  if __name__ == '__main__':
    x = Lunch()
    x.order('burritos')
    x.result()
    x.order('pizza')
    x.result()`
  </code></pre>
  
  <p>What I don't understand is how the definition of the method <code>placeOrder</code> inside the <code>customer</code> class works, more specifically, there is no class <code>employee</code> (just <code>Employee</code>) whose method <code>placeOrder</code> could be used.</p>