Python100天打卡-Day09-面向对象进阶

面向对象进阶 @property装饰器 若是想访问属性能够经过属性的getter(访问器)和setter(修改器)方法进行对应的操做。若是要作到这点,就能够考虑使用@property包装器来包装getter和setter方法,使得对属性的访问既安全又方便web class Person(object): def __init__(self, name, age): sel
相关文章
相关标签/搜索