class Animal:
  "The base class of the whole object zoo."

  def __init__(self, name):
    self.name = name

  def __str__(self):
    return self.name + " is an animal"

  def eat(self):
    print self.name + ", which is an animal, is eating."

class Mammal(Animal):
  "Mammals are animals that know how to suck milk."

  def __str__(self):
    return self.name + " is a mammal"

  def suckMilk(self):
    print self.name + ", which is a mammal, is sucking milk."

class Dog(Mammal):
  "Dogs are mammals that can bark, and bite when they eat."

  def __str__(self):
    return self.name + " is a dog"

  def bark(self):
    print self.name + " is barking rather loudly."

  def eat(self):
    print self.name + " barks when it eats."
    self.bark

class Flier:
  "Fliers are entities that can fly."
  def __init__(self, name, height):
    self.name = name
    self.height = height

  def fly(self):
    print self.name + " is flying ", self.height, " metters high!"

class Bat(Flier, Mammal):
  "Bats are mammals that fly."

  def __str__(self):
    return self.name + " is a bat"


def test0():
  a = Animal("Tigrinho")
  m = Mammal("Oncinha")
  d = Dog("Mameluco")
  print a
  print m
  print d
  a.eat()
  m.suckMilk()
  d.bark()

def test1():
  b = Bat("Vampirinho", 10)
  b.fly()

test1()

def test2():
  a1 = Animal("Tigrinho")
  a2 = Mammal("Oncinha")
  a3 = Dog("Mameluco")
  print a1
  print a2
  print a3
  a1.eat()
  a2.suckMilk()
  a2.eat()
  a3.bark()
  a3.suckMilk()
  a3.eat()
  a1.bark()
  a1 = a3
  a1.bark()

def test3():
  a = Mammal("Fortunato")
  if a.__class__.__name__ == Mammal.__name__:
    print "The thing is an animal!"
