一、简单的依赖方法
import datetime#依赖class Project: def __init__(self, name, team, start_date): self.name = name self.team = team self.start_date = start_date def __repr__(self): return f''class Developer: def __init__(self, name, skills): self.name = name self.skills = skills def __repr__(self): return f' ' def develop_project(self, project): print(f'{self.name}正在参与开发项目:{project}')if __name__ == "__main__": d = Developer('Tom', ['Python', 'SQL', 'Flask']) print(d) proj = Project('OA', 'DEV2', datetime.date(2018, 3, 7)) d.develop_project(proj) #依赖 Project的类