This Looks Like a Job For


#1

Hi all, I really cannot understand this section and what this "super" thing does. Please, a bit of more explanation would really help and thanks.To be more specified I want to know what super does and how the syntax of it works because I couldn't understand it from the instructions.I need help understanding these lines of code.Thanks.

 def full_time_wage (self, hours):
        self.hours = hours
        return super(PartTimeEmployee,self).calculate_wage(self.hours)
milton = PartTimeEmployee("milton")
print milton.full_time_wage(10)

#2

Found using google search
python super within def explain site:stackoverflow.com
https://stackoverflow.com/questions/222877/what-does-super-do-in-python?noredirect=1&lq=1

You could also search in the =Book=
super() site:python.org


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.