I started the course for python and its a good course. Tho i came across something i do not realy understand. At the lesson we are introduced with the super() method to get the old functionality after overriding a function.
Here the code where this is used:
class Employee(object): """Models real-life employees!""" def __init__(self, employee_name): self.employee_name = employee_name def calculate_wage(self, hours): self.hours = hours return hours * 20.00 # Add your code below! class PartTimeEmployee(Employee): def calculate_wage(self, hours): self.hours = hours return hours*12.00 def full_time_wage(self, hours): return super(PartTimeEmployee, self).calculate_wage(hours)
what is strange to me is why PartTimeEmployee is given in the method.
I tried playing around with it and giving other classes or other children but that seems to be throwing an error.
Why do i need to give PartTimeEmployee in the super() method ?
Is it possible to give other classes to the super() method ?
I have looked for documentation on this subject but i cant find any that addresses this very topic.