python __slots__ # 限制实例的属性?比如,只允许对Student实例添加name和age属性。 class Student(object): __slots__ = ('name', 'age') # 用tuple定义允许绑定的属性名称