
本文共 2582 字,大约阅读时间需要 8 分钟。
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������
- ���������������������������������������������������������������������������������������������������������������}``
���������������������
- ���������������������������������������������������������������������������������������������������������������������������������}``
���������������������
���������������High Cohesion���: ���������������������������������������������������������������������������������������������
���������������Separation of Concerns���: ������������������������������������������
**������������������������������������������������������������������������������������������
**������������������������������������������������������������������������������������������������������������������}. empowerment<
���������������
class Person: def __init__(self, name): self.name = name @property def name(self): return self.__name @name.setter def name(self, value): self.__name = value def go_to(self, str_position, type_): """���... :param str_position: ������ :param type_: ������ """ print(f"{self.name}���{str_position}") type_.run(str_position)class Car: def run(self, str_position): """������... :param str_position: ������ """ print(f"���������������:{str_position}") lz = Person("������")car = Car()# ��������������������� lz.go_to("������", car)
������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������`Person`������`Car`������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
