Discuss / Python / 交作业

交作业

Topic source

property可以是装饰器,也可以是类属性

装饰器:@property(获取),@xxx(方法名).srtter(设置),@xxx.deleter(删除)

类属性:variable=property(fun1(获取),fun2(设置),fun3(删除),'str')


  • 1

Reply