Python进阶-XVIII 封装、(属性、静态方法、类方法)语法糖、反射

1、封装

  类中的私有化:属性的私有化和方法的私有化

2、属性方法

  @property语法糖的使用

3、静态方法和类方法

  1)staticmethod

  2)classmethod

4、反射

  1)getattr

  2)delattr

  3)hasattr

  4)setattr

猜你喜欢

转载自www.cnblogs.com/funyou/p/12037566.html