## Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):

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

    def isalive(self):
        while self.lifespan > 0:
            self.lifespan -= 1
            return True
        return False

##Dog is-a Animal
class Dog(Animal):

    def __init__(self, name):
        ##Dog has-a name
        self.name = name

    def bark():
        print("Woof")

##Cat is-a Animal
class Cat(Animal):

    def __init__(self, name):
        ##Cat has-a name
        self.name = name



##Person is-a object
class Person(object):

    def __init__(self, name):
        ##Person has-a name
        self.name = name

        ## Person has-a pet of some kind
        self.pet = None

##Employee is-a Person
class Employee(Person):

    def __init__(self, name, salary):
        ##?? hmm, what is this strange magic?
        ## Employee overrides Person name attribute.
        super(Employee, self).__init__(name)
        ## Employee has-a salary
        self.salary = salary

##Fish is-a object
class Fish(object):
    pass

##Salmon is-a Fish
class Salmon(Fish):
    pass

##Halibut is-a Fish
class Halibut(Fish):
    pass

## rover is-a Dog
rover = Dog("Rover")

## satan is-a Cat
satan = Cat("Satan")

## mary is-a Person
mary = Person("Mary")

## mary has-a pet called Satan
mary.pet = satan

## frank is-a Employee
frank = Employee("Frank", 120000)

## frank has-a pet called rover
frank.pet = rover

## flipper is-a Fish
flipper = Fish()

## crouse is-a Salmon
crouse = Salmon()

## harry is-a Halibut, which is-a Fish
harry = Halibut()


taz = Animal(10)
print("Taz's lifespan is %d years" % taz.lifespan)
print("Is Taz alive?", taz.isalive())
print("Now Taz's lifespan is %d years" % taz.lifespan)

print(mary.name)

satan.lifespan = 0
print("Satan's lifespan is %d years." % satan.lifespan)
print("Is Satan alive?", satan.isalive())
