class Base:
def __init__(self, first, last):
console.warn(f"Base: __init__('{first}', '{last}')")
self.first = first
self.last = last
def __str__(self):
console.warn(f"Base: __str__({self.first} {self.last})")
return f"full name: {self.first} {self.last}"
class Employee(Base):
def __init__(self, first, last, boss):
console.warn(f"Employee: __init__('{first}', '{last}', '{boss}')")
super().__init__(first, last)
self.boss = boss
def __str__(self):
console.warn(f"Employee: __str__({self.first} {self.last}, {self.boss})")
full_name = super().__str__()
return f"Employee {full_name}, Boss: {self.boss}"
class Manager(Base):
def __init__(self, first, last, subordinate):
console.warn(f"Manager: __init__('{first}', '{last}', '{subordinate}')")
super().__init__(first, last)
self.subordinate = subordinate
def __str__(self):
console.warn(f"Manager: __str__({self.first} {self.last}, {self.subordinate})")
full_name = super().__str__()
return f"Manager {full_name}, Subordinate: {self.subordinate}"
base = Base('*first*', '*last*')
print(base)
employee = Employee('Akio', 'Kasai', 'Taro Yamada')
print(employee)
manager = Manager('Taro', 'Yamada', 'Akio Kasai')
print(manager)