14/19 (bug?) Got error "bound method" in the console but the exercise passed


#1

I submitted this code:

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    
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)            
milton = PartTimeEmployee("Rocky")
print milton.full_time_wage

The console answers with error:

<bound method PartTimeEmployee.full_time_wage of <PartTimeEmployee object at 0x7f8aa6835290>>
None

But the exercise passed with a green button"Congratulations, you've finished this section!"

Looks like a bug


#2

@digitalplayer74229

Well I see a few issues. One you are not inheriting the base class correctly which may or may not lead to issues.

After you inherit correctly your issues should go away if not post again.

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    
class PartTimeEmployee(Employee): # This class has to inherit the __init__
    def __init__(self, name):
        Employee.__init__(self, name)
    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)            
milton = PartTimeEmployee("Rocky")
print milton.full_time_wage

#3

My wrong code shouldn't pass the exercise but it did. I think it's a bug. (I new what was wrong with my code, but thanks anyway)


#4

You won't get an error message if you give an argument to your full_time_wage method when you calling it on milton. Like:
print milton.full_time_wage(10) ---> will result 200.0