下面的代码,不知道我做错了什么。它是一个员工数据库。下面继承自 Employee 类。不太确定该怎么做才能让它通过,除非我的代码是错误的。我收到此错误“ SyntaxError:关键字 arg 后的非关键字 arg”
class Manager(EmpSalaried): #inherits from EmpSalaried
def __init__(self, salary=0.0, firstName="", lastName="", ssID="", DOB=datetime.fromordinal(1),
startDate=datetime.today(),
manage=[]): #manage attribute added for manager
Employee.__init__(self, salary, firstName, lastName, ssID, DOB, startDate)
self.manage = manage
def __str__(self):
"""
>>> import datetime
>>> e = Manager(10, 'Bob', 'Quux', '123', startDate=datetime.datetime(2009, 1, 1),
['Michael', 'Bob', 'Hello'])
>>> print e
10, Bob Quux, 123, 0001-01-01 00:00:00, 2009-01-01 00:00:00, Michael, Bob, Hello
>>> b = Manager(2000, 'Bob', 'Lol', '1234', startDate=datetime.datetime(2009, 1, 1),
['Michael', 'Bob', 'Hello'])
>>> print b
2000, Bob Lol, 1234, 0001-01-01 00:00:00, 2009-01-01 00:00:00
"""
return Employee.__str__(self) + ', ' + str(self.manage) #need to convert to a string in order to add to string