2023年1月29日
摘要: 1 Python内置的@property机制弊端在于不方便复用 不能把它所修饰方法中的逻辑,套用在同一个类中的其他属性上。 例如,编写一个类记录分数 class Grade: def __init__(self): self._values = 0 @property def grade(self) 阅读全文
posted @ 2023-01-29 00:25 _gua 阅读(55) 评论(0) 推荐(0)