Discuss / Python / 关于@score.setter

关于@score.setter

Topic source

风笛手-

#1 Created at ... [Delete] [Delete and Lock User]

@score.setter是@property创建的还是我们自己创建的

在你给score这个方法加上@property这个装饰器时,python会自动创建@score.setter这个装饰器

犭查猹

#3 Created at ... [Delete] [Delete and Lock User]

是你自己创建的,不是自动创建的 你可以选择只创建@property不创建@XXX.setter就成了一个只读变量 这节最后说了


  • 1

Reply