>>> class MyData(): def __init__(self,name,phone): self.name=name self.phone=phone def updatephone(self,newphone): self.phone=newphone print 'new phone is:',self.phone >>> data=MyData('xiaodeng',28) #实例化 >>> delattr(data,'name') >>> data.__dict__ {'phone': 28} >>>