class Student(object): slots=('name','age') 用slots来定义只允许对Student实例添加 name和age属性。 但是slots定义的属性仅对当前类实例起作用,对继承的子类是不起作用的