我在Employee程序上运行了flake8,以检查是否符合PEP8,我唯一遇到的问题是以下代码行中的语法错误:
return print("Manager's ID:", self.id, "\nSalary:", self.salary,
有人可以告诉我上面一行中的语法错误吗?
对于上下文,该行来自一个名为info()的方法,该方法显示一些基本的Employee对象信息:
def info(self):
if isinstance(self, Manager):
return print("Manager's ID:", self.id, "\nSalary:", self.salary,
"\nEmployee's under supervision:", self.print_supervisees(),
"\nManager started here on:", self.start_time)
if isinstance(self, Supervisor):
return print("Supervisor's ID:", self.id, "\nSalary:", self.salary,
"\nEmployee's under supervision:", self.print_supervisees(),
"\nSupervisor started here on:", self.start_time)
elif isinstance(self, Developer):
return print("Developer's ID:", self.id, "\nSalary:", self.salary,
"\nPrograming Language:", self.programming_language,
"\nDeveloper stated here on:", self.start_time)
else:
return print("Employee ID:", self.id, "\nSalary:", self.salary,
"\nEmployee stated here on:", self.start_time)
据我所知,此语法错误不是由我的IDE抛出的,而据我所知,info()方法对所有雇员都适用。