TypeError: descriptor '__init__' requires a 'super' object but received a 'str'
Your super
call giving the error in the Developer
class should be:
super(Developer, self).__init__(f, l, a)
In the Manager
class:
super(Manager, self).__init__(f, l, a)
You have other issues, for example, in Employee
you have two attributes called raise_amount
, one is a float
and one is a method (function). That's not allowed and the float
takes precedence, so dev1.raise_amount()
fails.
In print_employee()
you mis-spell emp.fullname
Change all of your super.__init__(...)
calls to super().__init__(...)
. The problem was the missing pair of parentheses ()
.
From the official Python 3.3 reference here, super is actually a built-in function with the signature super([type[, object-or-type]])
.